File tree Expand file tree Collapse file tree 4 files changed +7
-15
lines changed
Expand file tree Collapse file tree 4 files changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -744,13 +744,9 @@ do {
744744
745745// https://github.com/apple/swift/issues/68825
746746do {
747- func x( a: Any ) {
748- _ = a is a
749- // expected-error@-1 {{type-casting operator expects a type on its right-hand side (got: parameter 'a')}}
750- // expected-note@-3 {{'a' declared here}}
751- _ = a as a
752- // expected-error@-1 {{type-casting operator expects a type on its right-hand side (got: parameter 'a')}}
753- // expected-note@-6 {{'a' declared here}}
747+ func x( a: Any ) { // expected-note 2 {{'a' declared here}}
748+ _ = a is a // expected-error {{type-casting operator expects a type on its right-hand side (got: parameter 'a')}}
749+ _ = a as a // expected-error {{type-casting operator expects a type on its right-hand side (got: parameter 'a')}}
754750 _ = a is Issue68825 // expected-error {{cannot find type 'Issue68825' in scope}}
755751 _ = a is String // OK
756752 }
Original file line number Diff line number Diff line change @@ -1709,9 +1709,8 @@ class CImplicitIdentityExpr { func gimme() -> CImplicitIdentityExpr { self } }
17091709
17101710class CImplicitDotSelfExpr { func gimme( ) -> CImplicitDotSelfExpr { self . self } }
17111711
1712- func badIs< T> ( _ value: Any , anInstanceOf type: T . Type ) -> Bool {
1712+ func badIs< T> ( _ value: Any , anInstanceOf type: T . Type ) -> Bool { // expected-note {{'type' declared here}}
17131713 value is type // expected-error {{type-casting operator expects a type on its right-hand side (got: parameter 'type')}}
1714- // expected-note@-2 {{'type' declared here}}
17151714}
17161715
17171716
Original file line number Diff line number Diff line change 11// RUN: %target-swift-frontend %s -typecheck -verify
22
3- func badIs< T> ( _ value: Any , anInstanceOf type: T . Type ) -> Bool {
3+ func badIs< T> ( _ value: Any , anInstanceOf type: T . Type ) -> Bool { // expected-note {{'type' declared here}}
44 value is type // expected-error {{type-casting operator expects a type on its right-hand side (got: parameter 'type')}}
5- // expected-note@-2 {{'type' declared here}}
65}
76
87func foo( ) -> Int {
98 return // expected-error {{non-void function should return a value}}
109}
1110
12- func badIs_ifdecl< T> ( _ value: Any , anInstanceOf type: T . Type ) -> Bool {
11+ func badIs_ifdecl< T> ( _ value: Any , anInstanceOf type: T . Type ) -> Bool { // expected-note {{'type' declared here}}
1312 #if true
1413 value is type // expected-error {{type-casting operator expects a type on its right-hand side (got: parameter 'type')}}
15- // expected-note@-3 {{'type' declared here}}
1614 #endif
1715}
1816
Original file line number Diff line number Diff line change @@ -2430,10 +2430,9 @@ class CImplicitIdentityExpr { func gimme() -> CImplicitIdentityExpr { self } }
24302430
24312431class CImplicitDotSelfExpr { func gimme( ) -> CImplicitDotSelfExpr { self . self } }
24322432
2433- func badIs< T> ( _ value: Any , anInstanceOf type: T . Type ) -> Bool {
2433+ func badIs< T> ( _ value: Any , anInstanceOf type: T . Type ) -> Bool { // expected-note {{'type' declared here}}
24342434 #if true
24352435 value is type // expected-error {{type-casting operator expects a type on its right-hand side (got: parameter 'type')}}
2436- // expected-note@-3 {{'type' declared here}}
24372436 #endif
24382437}
24392438
You can’t perform that action at this time.
0 commit comments