Skip to content

Commit 9a3ae2b

Browse files
committed
Unified: Remove redundant test constructors
1 parent a2e3839 commit 9a3ae2b

4 files changed

Lines changed: 835 additions & 861 deletions

File tree

‎unified/ql/test/library-tests/type-inference/classes.swift‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ func testNestedTypes() {
7878
class Builder {
7979
var value: Int = 0
8080

81-
init() {}
82-
8381
func set(_ v: Int) -> Builder {
8482
value = v // $ type=v:Int field=Builder.value
8583
return self
@@ -103,8 +101,6 @@ func testChaining() {
103101
// --- Default parameter values ---
104102

105103
class Config {
106-
init() {}
107-
108104
func setup(retries: Int = 3, timeout: Double = 30.0) -> Int {
109105
return retries // $ type=retries:Int
110106
}
@@ -144,8 +140,6 @@ func testTemperature() {
144140
// --- Inheritance with overriding ---
145141

146142
class Animal {
147-
init() {}
148-
149143
func speak() -> String {
150144
return "..."
151145
}

‎unified/ql/test/library-tests/type-inference/overload_resolution.swift‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// --- Overload by parameter type ---
22

33
class 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

3331
class 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

6359
class 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

9387
class 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

118110
class 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

205193
func testStaticVsInstance() {
@@ -294,8 +282,6 @@ func testOverrideResolution() {
294282
// --- Overload: by external vs internal parameter names ---
295283

296284
class 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

401387
class 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

Comments
 (0)