Skip to content

Commit 5b12e70

Browse files
committed
revert: Revert changes from https://github.com/scala/scala3/pull/22046/files since it doesn't compiler on LTS
1 parent 2cd04d8 commit 5b12e70

File tree

3 files changed

+2
-32
lines changed

3 files changed

+2
-32
lines changed

Diff for: compiler/src/dotty/tools/dotc/typer/Applications.scala

+2
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,8 @@ trait Applications extends Compatibility {
885885
val app1 =
886886
if !success then app0.withType(UnspecifiedErrorType)
887887
else {
888+
if isAnnotConstr(methRef.symbol) && !isJavaAnnotConstr(methRef.symbol) then
889+
typedArgs
888890
if !sameSeq(args, orderedArgs)
889891
&& !isJavaAnnotConstr(methRef.symbol)
890892
&& !typedArgs.forall(isSafeArg)

Diff for: tests/printing/dependent-annot-default-args.check

-23
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,16 @@ package <empty> {
88
final module class annot() extends AnyRef() { this: annot.type =>
99
def $lessinit$greater$default$2: Any @uncheckedVariance = 42
1010
}
11-
class annot2(x: Any, y: Array[Any]) extends annotation.Annotation() {
12-
private[this] val x: Any
13-
private[this] val y: Array[Any]
14-
}
15-
final lazy module val annot2: annot2 = new annot2()
16-
final module class annot2() extends AnyRef() { this: annot2.type =>
17-
def $lessinit$greater$default$1: Any @uncheckedVariance = -1
18-
def $lessinit$greater$default$2: Array[Any] @uncheckedVariance =
19-
Array.apply[Any](["Hello" : Any]*)(scala.reflect.ClassTag.Any)
20-
}
2111
final lazy module val dependent-annot-default-args$package:
2212
dependent-annot-default-args$package =
2313
new dependent-annot-default-args$package()
2414
final module class dependent-annot-default-args$package() extends Object() {
2515
this: dependent-annot-default-args$package.type =>
2616
def f(x: Int): Int @annot(x) = x
27-
def f2(x: Int):
28-
Int @annot2(
29-
y = Array.apply[Any](["Hello",x : Any]*)(scala.reflect.ClassTag.Any))
30-
= x
3117
def test: Unit =
3218
{
3319
val y: Int = ???
3420
val z: Int @annot(y) = f(y)
35-
val z2:
36-
Int @annot2(
37-
y = Array.apply[Any](["Hello",y : Any]*)(scala.reflect.ClassTag.Any)
38-
)
39-
= f2(y)
40-
@annot(44) val z3: Int = 45
41-
@annot2(
42-
y = Array.apply[Any](["Hello",y : Any]*)(scala.reflect.ClassTag.Any))
43-
val z4: Int = 45
4421
()
4522
}
4623
}

Diff for: tests/printing/dependent-annot-default-args.scala

-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
class annot(x: Any, y: Any = 42) extends annotation.Annotation
2-
class annot2(x: Any = -1, y: Array[Any] = Array("Hello")) extends annotation.Annotation
3-
42
def f(x: Int): Int @annot(x) = x
5-
def f2(x: Int): Int @annot2(y = Array("Hello", x)) = x
63

74
def test =
85
val y: Int = ???
9-
106
val z = f(y)
11-
val z2 = f2(y)
12-
13-
@annot(44) val z3 = 45
14-
@annot2(y = Array("Hello", y)) val z4 = 45
15-

0 commit comments

Comments
 (0)