Files
swift-mirror/test/attr/attr_inout.swift
David Zarzycki 31d8153097 [Sema] QoI: Report all tuple type resolution errors
This improves single pass diagnostics when more than one tuple type
element has problems.
2019-03-11 16:03:17 -04:00

14 lines
499 B
Swift

// RUN: %target-typecheck-verify-swift
func f(x : inout Int) { } // okay
func h(_ : inout Int) -> (inout Int) -> (inout Int) -> Int { }
func ff(x: (inout Int, inout Float)) { } // expected-error 2{{'inout' may only be used on parameters}}
enum inout_carrier {
case carry(inout Int) // expected-error {{'inout' may only be used on parameters}}
}
func deprecated(inout x: Int) {} // expected-error {{'inout' before a parameter name is not allowed, place it before the parameter type instead}}