11// --- Overload by parameter type ---
22
33class OverloadByType {
4- public init ( ) { }
5-
64 func handle( _ x: Int ) -> String { // name=OverloadByType.handle1
75 return " int "
86 }
@@ -31,8 +29,6 @@ func testOverloadByType() {
3129// --- Overload by argument label ---
3230
3331class OverloadByLabel {
34- public init ( ) { }
35-
3632 func configure( width: Int ) -> String { // name=OverloadByLabel.configure1
3733 return " width "
3834 }
@@ -61,8 +57,6 @@ func testOverloadByLabel() {
6157// --- Overload by arity (number of parameters) ---
6258
6359class OverloadByArity {
64- public init ( ) { }
65-
6660 func compute( ) -> Int { // name=OverloadByArity.compute1
6761 return 0
6862 }
@@ -91,8 +85,6 @@ func testOverloadByArity() {
9185// --- Overload by return type (contextual type) ---
9286
9387class OverloadByReturn {
94- public init ( ) { }
95-
9688 func create( ) -> Int { // name=OverloadByReturn.create1
9789 return 0
9890 }
@@ -116,8 +108,6 @@ func testOverloadByReturn() {
116108// --- Overload: generic vs non-generic (non-generic preferred) ---
117109
118110class OverloadGenericVsConcrete {
119- public init ( ) { }
120-
121111 func process( _ x: Int ) -> String { // name=OverloadGenericVsConcrete.process1
122112 return " concrete "
123113 }
@@ -198,8 +188,6 @@ class StaticVsInstance {
198188 static func action( ) -> String { // name=StaticVsInstance.action2
199189 return " static "
200190 }
201-
202- init ( ) { }
203191}
204192
205193func testStaticVsInstance( ) {
@@ -294,8 +282,6 @@ func testOverrideResolution() {
294282// --- Overload: by external vs internal parameter names ---
295283
296284class LabelVariants {
297- public init ( ) { }
298-
299285 func send( to target: String ) -> String { // name=LabelVariants.send1
300286 return target // $ type=target:String
301287 }
@@ -399,8 +385,6 @@ func testConvenienceInit() {
399385// --- Overload: methods with closure parameters of different signatures ---
400386
401387class Processor {
402- init ( ) { }
403-
404388 func apply( _ f: ( Int ) -> Int ) -> Int { // name=Processor.apply1
405389 return f ( 0 ) // $ target=Function.callAsFunction
406390 }
@@ -427,8 +411,6 @@ class MultiSubscript {
427411 var data : [ Int ] = [ 1 , 2 , 3 ]
428412 var dict : [ String : Int ] = [ " a " : 1 ]
429413
430- init ( ) { }
431-
432414 func get( _ index: Int ) -> Int { // name=MultiSubscript.get1
433415 return data [ index] // $ field=MultiSubscript.data
434416 }
0 commit comments