You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1as!A<B>.F << 2 // expected-warning{{cast from 'Int' to unrelated type 'A<B>.F' always fails}} // expected-error {{referencing operator function '<<' on 'BinaryInteger' requires that 'A<B>.F' conform to 'BinaryInteger'}}
83
-
1as!A<B> << 2 // expected-warning{{cast from 'Int' to unrelated type 'A<B>' always fails}} expected-error{{referencing operator function '<<' on 'BinaryInteger' requires that 'A<B>' conform to 'BinaryInteger'}}
82
+
1as!A<B>.F << 2 // expected-warning {{cast from 'Int' to unrelated type 'A<B>.F' always fails}}
83
+
// expected-error@-1 {{referencing operator function '<<' on 'BinaryInteger' requires that 'A<B>.F' conform to 'BinaryInteger'}}
84
+
1as!A<B> << 2 // expected-warning {{cast from 'Int' to unrelated type 'A<B>' always fails}}
85
+
// expected-error@-1 {{referencing operator function '<<' on 'BinaryInteger' requires that 'A<B>' conform to 'BinaryInteger'}}
84
86
let _ =1asInt16 << 7
85
-
let _ =1as?Int16 << 7 // expected-error{{value of optional type 'Int16?' must be unwrapped to a value of type 'Int16'}} expected-warning{{conditional downcast from literal to 'Int16' always fails; consider using 'as' coercion}} expected-note{{coalesce using '??' to provide a default when the optional value contains 'nil'}} expected-note{{force-unwrap using '!' to abort execution if the optional value contains 'nil'}}
86
-
let _ =1 is Int16 << 7 // expected-warning{{conditional downcast from literal to 'Int16' always fails; consider using 'as' coercion}} expected-error{{binary operator '<<' cannot be applied to operands of type 'Bool' and 'Int'}}
87
-
let _ =1as!Int16 << 7 // expected-warning{{conditional downcast from literal to 'Int16' always fails; consider using 'as' coercion}}
87
+
let _ =1as?Int16 << 7 // expected-error {{value of optional type 'Int16?' must be unwrapped to a value of type 'Int16'}}
88
+
// expected-warning@-1 {{conditional downcast from literal to 'Int16' always fails; consider using 'as' coercion}}
89
+
// expected-note@-2 {{coalesce using '??' to provide a default when the optional value contains 'nil'}}
90
+
// expected-note@-3 {{force-unwrap using '!' to abort execution if the optional value contains 'nil'}}
91
+
let _ =1 is Int16 << 7 // expected-warning {{conditional downcast from literal to 'Int16' always fails; consider using 'as' coercion}}
92
+
// expected-error@-1 {{binary operator '<<' cannot be applied to operands of type 'Bool' and 'Int'}}
93
+
let _ =1as!Int16 << 7 // expected-warning {{conditional downcast from literal to 'Int16' always fails; consider using 'as' coercion}}
88
94
let _ =1asInt16<=7
89
95
// FIXME: this should not produce any errors.
90
-
let _ =1asInt16<7 // expected-error{{expected type}}
96
+
let _ =1asInt16<7 // expected-error{{expected type}}
0 commit comments