File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %target-typecheck-verify-swift
2
+
3
+ protocol Protocol {
4
+ associatedtype Index : Comparable
5
+ subscript( bounds: Range < Index > ) -> Int { get }
6
+ // expected-note@+1 {{protocol requires subscript with type '(Wrapper<Base>.Index) -> Int' (aka '(Base.Index) -> Int'); do you want to add a stub?}}
7
+ subscript( position: Index ) -> Int { get }
8
+ }
9
+
10
+ struct Wrapper < Base: Protocol > : Protocol { // expected-error {{type 'Wrapper<Base>' does not conform to protocol 'Protocol'}}
11
+ typealias Index = Base . Index
12
+ subscript( bounds: Range < Index > ) -> Int { // expected-note {{candidate has non-matching type '<Base> (Range<Wrapper<Base>.Index>) -> Int' (aka '<Base> (Range<Base.Index>) -> Int')}}
13
+ get { 1 }
14
+ }
15
+ }
You can’t perform that action at this time.
0 commit comments