@@ -135,19 +135,30 @@ protocol BaseP {
135
135
var value: MyStruct
136
136
}
137
137
class BaseC {
138
+ func baseMethod( x: Int ) -> Int { }
139
+ func baseMethodWithName( x y: Int ) -> Int { }
140
+ func baseMethodWithEmptyName( _ y: Int ) -> Int { }
141
+
138
142
func baseMethodAsync( x: Int ) async -> Int { }
139
143
func genericAsyncThrowsConstraint< T, U> ( x: T ) async throws -> U . Element where U: Collection , U. Element == Int { }
140
144
subscript( index: Int ) -> ( Int ) -> Int { }
145
+ subscript( withName index: Int ) -> Float { }
146
+ subscript( _ index: String ) -> String { }
141
147
}
142
148
class DerivedC: BaseC , BaseP {
143
149
#^OVERRIDE^#
144
150
// OVERRIDE: Begin completions
145
151
// OVERRIDE-DAG: Keyword[func]/None: <keyword>func</keyword>; typename=; name=func; sourcetext=func
146
152
// OVERRIDE-DAG: Decl[InstanceMethod]/Super: <name>protoMethod</name>() -> (<typeid.sys>UInt8</typeid.sys>) -> <typeid.sys>Void</typeid.sys>; typename=; name=protoMethod(); sourcetext=func protoMethod() -> (UInt8) -> Void {\n<#code#>\n}
147
153
// OVERRIDE-DAG: Decl[InstanceVar]/Super: <name>value</name>: <typeid.user>MyStruct</typeid.user>; typename=; name=value; sourcetext=var value: MyStruct
154
+ // OVERRIDE-DAG: Decl[InstanceMethod]/Super: <name>baseMethod</name>(<param><param.label>x</param.label>: <param.type><typeid.sys>Int</typeid.sys></param.type></param>) -> <typeid.sys>Int</typeid.sys>; typename=; name=baseMethod(x:); sourcetext=override func baseMethod(x: Int) -> Int {\n<#code#>\n}
155
+ // OVERRIDE-DAG: Decl[InstanceMethod]/Super: <name>baseMethodWithName</name>(<param><param.label>x</param.label> <param.param>y</param.param>: <param.type><typeid.sys>Int</typeid.sys></param.type></param>) -> <typeid.sys>Int</typeid.sys>; typename=; name=baseMethodWithName(x:); sourcetext=override func baseMethodWithName(x y: Int) -> Int {\n<#code#>\n}
156
+ // OVERRIDE-DAG: Decl[InstanceMethod]/Super: <name>baseMethodWithEmptyName</name>(<param><param.label>_</param.label> <param.param>y</param.param>: <param.type><typeid.sys>Int</typeid.sys></param.type></param>) -> <typeid.sys>Int</typeid.sys>; typename=; name=baseMethodWithEmptyName(:); sourcetext=override func baseMethodWithEmptyName(_ y: Int) -> Int {\n<#code#>\n}
148
157
// OVERRIDE-DAG: Decl[InstanceMethod]/Super: <name>baseMethodAsync</name>(<param><param.label>x</param.label>: <param.type><typeid.sys>Int</typeid.sys></param.type></param>) <keyword>async</keyword> -> <typeid.sys>Int</typeid.sys>; typename=; name=baseMethodAsync(x:); sourcetext=override func baseMethodAsync(x: Int) async -> Int {\n<#code#>\n}
149
158
// OVERRIDE-DAG: Decl[InstanceMethod]/Super: <name>genericAsyncThrowsConstraint</name><T, U>(<param><param.label>x</param.label>: <param.type><typeid.user>T</typeid.user></param.type></param>) <keyword>async</keyword> <keyword>throws</keyword> -> <typeid.user>U</typeid.user>.<typeid.sys>Element</typeid.sys> <keyword>where</keyword> <typeid.user>U</typeid.user> : <typeid.sys>Collection</typeid.sys>, <typeid.user>U</typeid.user>.<typeid.sys>Element</typeid.sys> == <typeid.sys>Int</typeid.sys>; typename=; name=genericAsyncThrowsConstraint(x:); sourcetext=override func genericAsyncThrowsConstraint<T, U>(x: T) async throws -> U.Element where U : Collection, U.Element == Int {\n<#code#>\n}
150
159
// OVERRIDE-DAG: Decl[Subscript]/Super: <name>subscript</name>(<param><param.param>index</param.param>: <param.type><typeid.sys>Int</typeid.sys></param.type></param>) -> (<typeid.sys>Int</typeid.sys>) -> <typeid.sys>Int</typeid.sys>; typename=; name=subscript(:); sourcetext=override subscript(index: Int) -> (Int) -> Int {\n<#code#>\n}
160
+ // OVERRIDE-DAG: Decl[Subscript]/Super: <name>subscript</name>(<param><param.label>withName</param.label> <param.param>index</param.param>: <param.type><typeid.sys>Int</typeid.sys></param.type></param>) -> <typeid.sys>Float</typeid.sys>; typename=; name=subscript(withName:); sourcetext=override subscript(withName index: Int) -> Float {\n<#code#>\n}
161
+ // OVERRIDE-DAG: Decl[Subscript]/Super: <name>subscript</name>(<param><param.param>index</param.param>: <param.type><typeid.sys>String</typeid.sys></param.type></param>) -> <typeid.sys>String</typeid.sys>; typename=; name=subscript(:); sourcetext=override subscript(index: String) -> String {\n<#code#>\n}
151
162
// OVERRIDE-DAG: Decl[Constructor]/Super: <name>init</name>(); typename=; name=init(); sourcetext=override init() {\n<#code#>\n}
152
163
// OVERRIDE: End completions
153
164
}
0 commit comments