Skip to content

Commit 0dff94d

Browse files
allanrenuccicheeseng
authored andcommitted
Fix Eta expansion: scala/scala3#3246
1 parent ffbbe17 commit 0dff94d

22 files changed

+144
-144
lines changed

scalatest/src/main/scala/org/scalatest/AsyncFlatSpecLike.scala

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ trait AsyncFlatSpecLike extends AsyncTestSuite with AsyncTestRegistration with S
275275
* </p>
276276
*/
277277
def in(testFun: => Future[compatible.Assertion])(implicit pos: source.Position): Unit = {
278-
registerTestToRun(verb.trim + " " + name.trim, "in", tags, testFun _, pos)
278+
registerTestToRun(verb.trim + " " + name.trim, "in", tags, () => testFun, pos)
279279
}
280280

281281
/**
@@ -297,7 +297,7 @@ trait AsyncFlatSpecLike extends AsyncTestSuite with AsyncTestRegistration with S
297297
* </p>
298298
*/
299299
def is(testFun: => PendingStatement)(implicit pos: source.Position): Unit = {
300-
registerPendingTestToRun(verb.trim + " " + name.trim, "is", tags, testFun _, pos)
300+
registerPendingTestToRun(verb.trim + " " + name.trim, "is", tags, () => testFun, pos)
301301
}
302302

303303
/**
@@ -319,7 +319,7 @@ trait AsyncFlatSpecLike extends AsyncTestSuite with AsyncTestRegistration with S
319319
* </p>
320320
*/
321321
def ignore(testFun: => Future[compatible.Assertion])(implicit pos: source.Position): Unit = {
322-
registerTestToIgnore(verb.trim + " " + name.trim, tags, "ignore", testFun _, pos)
322+
registerTestToIgnore(verb.trim + " " + name.trim, tags, "ignore", () => testFun, pos)
323323
}
324324
}
325325

@@ -387,7 +387,7 @@ trait AsyncFlatSpecLike extends AsyncTestSuite with AsyncTestRegistration with S
387387
* </p>
388388
*/
389389
def in(testFun: => Future[compatible.Assertion])(implicit pos: source.Position): Unit = {
390-
registerTestToRun(verb.trim + " " + name.trim, "in", List(), testFun _, pos)
390+
registerTestToRun(verb.trim + " " + name.trim, "in", List(), () => testFun, pos)
391391
}
392392

393393
/**
@@ -408,7 +408,7 @@ trait AsyncFlatSpecLike extends AsyncTestSuite with AsyncTestRegistration with S
408408
* </p>
409409
*/
410410
def is(testFun: => PendingStatement)(implicit pos: source.Position): Unit = {
411-
registerPendingTestToRun(verb.trim + " " + name.trim, "is", List(), testFun _, pos)
411+
registerPendingTestToRun(verb.trim + " " + name.trim, "is", List(), () => testFun, pos)
412412
}
413413

414414
/**
@@ -429,7 +429,7 @@ trait AsyncFlatSpecLike extends AsyncTestSuite with AsyncTestRegistration with S
429429
* </p>
430430
*/
431431
def ignore(testFun: => Future[compatible.Assertion])(implicit pos: source.Position): Unit = {
432-
registerTestToIgnore(verb.trim + " " + name.trim, List(), "ignore", testFun _, pos)
432+
registerTestToIgnore(verb.trim + " " + name.trim, List(), "ignore", () => testFun, pos)
433433
}
434434

435435
/**
@@ -681,7 +681,7 @@ trait AsyncFlatSpecLike extends AsyncTestSuite with AsyncTestRegistration with S
681681
* </p>
682682
*/
683683
def in(testFun: => Future[compatible.Assertion])(implicit pos: source.Position): Unit = {
684-
registerTestToIgnore(verb.trim + " " + name.trim, tags, "in", testFun _, pos)
684+
registerTestToIgnore(verb.trim + " " + name.trim, tags, "in", () => testFun, pos)
685685
}
686686

687687
/**
@@ -711,7 +711,7 @@ trait AsyncFlatSpecLike extends AsyncTestSuite with AsyncTestRegistration with S
711711
* </p>
712712
*/
713713
def is(testFun: => PendingStatement)(implicit pos: source.Position): Unit = {
714-
registerPendingTestToIgnore(verb.trim + " " + name.trim, tags, "is", testFun _, pos)
714+
registerPendingTestToIgnore(verb.trim + " " + name.trim, tags, "is", () => testFun, pos)
715715
}
716716
// Note: no def ignore here, so you can't put two ignores in the same line
717717
}
@@ -778,7 +778,7 @@ trait AsyncFlatSpecLike extends AsyncTestSuite with AsyncTestRegistration with S
778778
* </p>
779779
*/
780780
def in(testFun: => Future[compatible.Assertion])(implicit pos: source.Position): Unit = {
781-
registerTestToIgnore(verb.trim + " " + name.trim, List(), "in", testFun _, pos)
781+
registerTestToIgnore(verb.trim + " " + name.trim, List(), "in", () => testFun, pos)
782782
}
783783

784784
/**
@@ -807,7 +807,7 @@ trait AsyncFlatSpecLike extends AsyncTestSuite with AsyncTestRegistration with S
807807
* </p>
808808
*/
809809
def is(testFun: => PendingStatement)(implicit pos: source.Position): Unit = {
810-
registerPendingTestToIgnore(verb.trim + " " + name.trim, List(), "is", testFun _, pos)
810+
registerPendingTestToIgnore(verb.trim + " " + name.trim, List(), "is", () => testFun, pos)
811811
}
812812

813813
/**
@@ -990,7 +990,7 @@ trait AsyncFlatSpecLike extends AsyncTestSuite with AsyncTestRegistration with S
990990
* </p>
991991
*/
992992
def in(testFun: => Future[compatible.Assertion])(implicit pos: source.Position): Unit = {
993-
registerTestToRun(verb.trim + " " + name.trim, "in", tags, testFun _, pos)
993+
registerTestToRun(verb.trim + " " + name.trim, "in", tags, () => testFun, pos)
994994
}
995995

996996
/**
@@ -1012,7 +1012,7 @@ trait AsyncFlatSpecLike extends AsyncTestSuite with AsyncTestRegistration with S
10121012
* </p>
10131013
*/
10141014
def is(testFun: => PendingStatement)(implicit pos: source.Position): Unit = {
1015-
registerPendingTestToRun(verb.trim + " " + name.trim, "is", tags, testFun _, pos)
1015+
registerPendingTestToRun(verb.trim + " " + name.trim, "is", tags, () => testFun, pos)
10161016
}
10171017

10181018
/**
@@ -1034,7 +1034,7 @@ trait AsyncFlatSpecLike extends AsyncTestSuite with AsyncTestRegistration with S
10341034
* </p>
10351035
*/
10361036
def ignore(testFun: => Future[compatible.Assertion])(implicit pos: source.Position): Unit = {
1037-
registerTestToIgnore(verb.trim + " " + name.trim, tags, "ignore", testFun _, pos)
1037+
registerTestToIgnore(verb.trim + " " + name.trim, tags, "ignore", () => testFun, pos)
10381038
}
10391039
}
10401040

@@ -1102,7 +1102,7 @@ trait AsyncFlatSpecLike extends AsyncTestSuite with AsyncTestRegistration with S
11021102
* </p>
11031103
*/
11041104
def in(testFun: => Future[compatible.Assertion])(implicit pos: source.Position): Unit = {
1105-
registerTestToRun(verb.trim + " " + name.trim, "in", List(), testFun _, pos)
1105+
registerTestToRun(verb.trim + " " + name.trim, "in", List(), () => testFun, pos)
11061106
}
11071107

11081108
/**
@@ -1123,7 +1123,7 @@ trait AsyncFlatSpecLike extends AsyncTestSuite with AsyncTestRegistration with S
11231123
* </p>
11241124
*/
11251125
def is(testFun: => PendingStatement)(implicit pos: source.Position): Unit = {
1126-
registerPendingTestToRun(verb.trim + " " + name.trim, "is", List(), testFun _, pos)
1126+
registerPendingTestToRun(verb.trim + " " + name.trim, "is", List(), () => testFun, pos)
11271127
}
11281128

11291129
/**
@@ -1144,7 +1144,7 @@ trait AsyncFlatSpecLike extends AsyncTestSuite with AsyncTestRegistration with S
11441144
* </p>
11451145
*/
11461146
def ignore(testFun: => Future[compatible.Assertion])(implicit pos: source.Position): Unit = {
1147-
registerTestToIgnore(verb.trim + " " + name.trim, List(), "ignore", testFun _, pos)
1147+
registerTestToIgnore(verb.trim + " " + name.trim, List(), "ignore", () => testFun, pos)
11481148
}
11491149

11501150
/**
@@ -1403,7 +1403,7 @@ import resultOfStringPassedToVerb.verb
14031403
* </p>
14041404
*/
14051405
def in(testFun: => Future[compatible.Assertion])(implicit pos: source.Position): Unit = {
1406-
registerTestToRun(verb.trim + " " + rest.trim, "in", List(), testFun _, pos)
1406+
registerTestToRun(verb.trim + " " + rest.trim, "in", List(), () => testFun, pos)
14071407
}
14081408

14091409
/**
@@ -1424,7 +1424,7 @@ import resultOfStringPassedToVerb.verb
14241424
* </p>
14251425
*/
14261426
def ignore(testFun: => Future[compatible.Assertion])(implicit pos: source.Position): Unit = {
1427-
registerTestToIgnore(verb.trim + " " + rest.trim, List(), "ignore", testFun _, pos)
1427+
registerTestToIgnore(verb.trim + " " + rest.trim, List(), "ignore", () => testFun, pos)
14281428
}
14291429
}
14301430

@@ -1501,7 +1501,7 @@ import resultOfStringPassedToVerb.verb
15011501
* </p>
15021502
*/
15031503
def in(testFun: => Future[compatible.Assertion])(implicit pos: source.Position): Unit = {
1504-
registerTestToRun(verb.trim + " " + rest.trim, "in", tagsList, testFun _, pos)
1504+
registerTestToRun(verb.trim + " " + rest.trim, "in", tagsList, () => testFun, pos)
15051505
}
15061506

15071507
/**
@@ -1524,7 +1524,7 @@ import resultOfStringPassedToVerb.verb
15241524
* </p>
15251525
*/
15261526
def ignore(testFun: => Future[compatible.Assertion])(implicit pos: source.Position): Unit = {
1527-
registerTestToIgnore(verb.trim + " " + rest.trim, tagsList, "ignore", testFun _, pos)
1527+
registerTestToIgnore(verb.trim + " " + rest.trim, tagsList, "ignore", () => testFun, pos)
15281528
}
15291529
}
15301530

@@ -1565,7 +1565,7 @@ import resultOfStringPassedToVerb.verb
15651565
new ResultOfStringPassedToVerb(verb, rest) {
15661566

15671567
def is(testFun: => PendingStatement): Unit = {
1568-
registerPendingTestToRun(verb.trim + " " + rest.trim, "is", List(), testFun _, pos)
1568+
registerPendingTestToRun(verb.trim + " " + rest.trim, "is", List(), () => testFun, pos)
15691569
}
15701570
// Note, won't have an is method that takes fixture => PendingStatement one, because don't want
15711571
// to say is (fixture => pending), rather just say is (pending)
@@ -1575,7 +1575,7 @@ import resultOfStringPassedToVerb.verb
15751575
// "A Stack" should "bla bla" taggedAs(SlowTest) is (pending)
15761576
// ^
15771577
def is(testFun: => PendingStatement): Unit = {
1578-
registerPendingTestToRun(verb.trim + " " + rest.trim, "is", tags, testFun _, pos)
1578+
registerPendingTestToRun(verb.trim + " " + rest.trim, "is", tags, () => testFun, pos)
15791579
}
15801580
}
15811581
}

scalatest/src/main/scala/org/scalatest/AsyncFreeSpecLike.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ trait AsyncFreeSpecLike extends AsyncTestSuite with AsyncTestRegistration with I
202202
* </p>
203203
*/
204204
def in(testFun: => Future[compatible.Assertion]): Unit = {
205-
registerTestToRun(specText, tags, testFun _, pos)
205+
registerTestToRun(specText, tags, () => testFun, pos)
206206
}
207207

208208
/**
@@ -222,7 +222,7 @@ trait AsyncFreeSpecLike extends AsyncTestSuite with AsyncTestRegistration with I
222222
* </p>
223223
*/
224224
def is(testFun: => PendingStatement): Unit = {
225-
registerPendingTestToRun(specText, tags, testFun _, pos)
225+
registerPendingTestToRun(specText, tags, () => testFun, pos)
226226
}
227227

228228
/**
@@ -242,7 +242,7 @@ trait AsyncFreeSpecLike extends AsyncTestSuite with AsyncTestRegistration with I
242242
* </p>
243243
*/
244244
def ignore(testFun: => Future[compatible.Assertion]): Unit = {
245-
registerTestToIgnore(specText, tags, "ignore", testFun _, pos)
245+
registerTestToIgnore(specText, tags, "ignore", () => testFun, pos)
246246
}
247247
}
248248

@@ -293,7 +293,7 @@ trait AsyncFreeSpecLike extends AsyncTestSuite with AsyncTestRegistration with I
293293
* </p>
294294
*/
295295
def in(f: => Future[compatible.Assertion]): Unit = {
296-
registerTestToRun(string, List(), f _, pos)
296+
registerTestToRun(string, List(), () => f, pos)
297297
}
298298

299299
/**
@@ -313,7 +313,7 @@ trait AsyncFreeSpecLike extends AsyncTestSuite with AsyncTestRegistration with I
313313
* </p>
314314
*/
315315
def ignore(f: => Future[compatible.Assertion]): Unit = {
316-
registerTestToIgnore(string, List(), "ignore", f _, pos)
316+
registerTestToIgnore(string, List(), "ignore", () => f, pos)
317317
}
318318

319319
/**
@@ -333,7 +333,7 @@ trait AsyncFreeSpecLike extends AsyncTestSuite with AsyncTestRegistration with I
333333
* </p>
334334
*/
335335
def is(f: => PendingStatement): Unit = {
336-
registerPendingTestToRun(string, List(), f _, pos)
336+
registerPendingTestToRun(string, List(), () => f, pos)
337337
}
338338

339339
/**

0 commit comments

Comments
 (0)