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) {
333333 return SE->getBase ();
334334 } else if (auto *DSE = dyn_cast<DotSelfExpr>(expr)) {
335335 return DSE->getSubExpr ();
336+ } else if (auto *USE = dyn_cast<UnresolvedSpecializeExpr>(expr)) {
337+ return USE->getSubExpr ();
336338 } else if (auto *CCE = dyn_cast<CodeCompletionExpr>(expr)) {
337339 return CCE->getBase ();
338340 } else {
Original file line number Diff line number Diff line change 22// RUN: %target-typecheck-verify-swift -swift-version 6 -verify-additional-prefix swift6-
33
44extension Int {
5- func foo( ) -> Int { } // expected-note 2 {{'foo()' declared here}}
5+ func foo( ) -> Int { } // expected-note 3 {{'foo()' declared here}}
66 var bar : Int {
77 get { }
88 }
@@ -40,6 +40,12 @@ func test(i: Int) {
4040 // expected-swift6-error@-2 {{cannot specialize non-generic type 'Int'}}
4141}
4242
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+
4349extension Bool {
4450 func foo< T> ( ) -> T { } // expected-note {{'foo()' declared here}}
4551}
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