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 {
744
744
745
745
// https://github.com/apple/swift/issues/68825
746
746
do {
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')}}
754
750
_ = a is Issue68825 // expected-error {{cannot find type 'Issue68825' in scope}}
755
751
_ = a is String // OK
756
752
}
Original file line number Diff line number Diff line change @@ -1709,9 +1709,8 @@ class CImplicitIdentityExpr { func gimme() -> CImplicitIdentityExpr { self } }
1709
1709
1710
1710
class CImplicitDotSelfExpr { func gimme( ) -> CImplicitDotSelfExpr { self . self } }
1711
1711
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}}
1713
1713
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}}
1715
1714
}
1716
1715
1717
1716
Original file line number Diff line number Diff line change 1
1
// RUN: %target-swift-frontend %s -typecheck -verify
2
2
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}}
4
4
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}}
6
5
}
7
6
8
7
func foo( ) -> Int {
9
8
return // expected-error {{non-void function should return a value}}
10
9
}
11
10
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}}
13
12
#if true
14
13
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}}
16
14
#endif
17
15
}
18
16
Original file line number Diff line number Diff line change @@ -2430,10 +2430,9 @@ class CImplicitIdentityExpr { func gimme() -> CImplicitIdentityExpr { self } }
2430
2430
2431
2431
class CImplicitDotSelfExpr { func gimme( ) -> CImplicitDotSelfExpr { self . self } }
2432
2432
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}}
2434
2434
#if true
2435
2435
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}}
2437
2436
#endif
2438
2437
}
2439
2438
You can’t perform that action at this time.
0 commit comments