File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -333,6 +333,8 @@ static Expr *getMemberChainSubExpr(Expr *expr) {
333
333
return SE->getBase ();
334
334
} else if (auto *DSE = dyn_cast<DotSelfExpr>(expr)) {
335
335
return DSE->getSubExpr ();
336
+ } else if (auto *USE = dyn_cast<UnresolvedSpecializeExpr>(expr)) {
337
+ return USE->getSubExpr ();
336
338
} else if (auto *CCE = dyn_cast<CodeCompletionExpr>(expr)) {
337
339
return CCE->getBase ();
338
340
} else {
Original file line number Diff line number Diff line change 2
2
// RUN: %target-typecheck-verify-swift -swift-version 6 -verify-additional-prefix swift6-
3
3
4
4
extension Int {
5
- func foo( ) -> Int { } // expected-note 2 {{'foo()' declared here}}
5
+ func foo( ) -> Int { } // expected-note 3 {{'foo()' declared here}}
6
6
var bar : Int {
7
7
get { }
8
8
}
@@ -40,6 +40,12 @@ func test(i: Int) {
40
40
// expected-swift6-error@-2 {{cannot specialize non-generic type 'Int'}}
41
41
}
42
42
43
+ func testOptionalChain( i: Int ? ) {
44
+ let _ = i? . foo< Int> ( )
45
+ // expected-swift5-warning@-1 {{cannot explicitly specialize instance method 'foo()'}}
46
+ // expected-swift6-error@-2 {{cannot explicitly specialize instance method 'foo()'}}
47
+ }
48
+
43
49
extension Bool {
44
50
func foo< T> ( ) -> T { } // expected-note {{'foo()' declared here}}
45
51
}
Original file line number Diff line number Diff line change
1
+ // RUN: %target-typecheck-verify-swift
2
+
3
+
4
+ struct Outer {
5
+ struct Inner {
6
+ struct Foo < T> {
7
+ static func id( _ v: T ) -> T { v }
8
+ }
9
+ }
10
+ }
11
+
12
+ let _: Outer = . Inner . Foo < Outer > . id( . init( ) )
13
+
You can’t perform that action at this time.
0 commit comments