-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation test failures with Scala 2 CC library TASTy #19652
Comments
Minimization of // Test.scala
def test = Vector(1).view.updated(0,2)
1 |def test = Vector(1).view.updated(0,2)
| ^^^^^^^^^^^^^^^^^^^^^^
| value updated is not a member of scala.collection.IndexedSeqView[Int] |
Orphan parameter while Ychecking with CC library. Minimization of class Test:
def f(xs: Set[Int]) = xs collect { case x => x }
def g(xs: Set[Int]): Set[Int] = f(xs)
checking tests/pos/t6925.scala after phase typer
exception while retyping def g(xs: Set[Int]): Set[Int] = this.f(xs) of class DefDef # -1
An unhandled exception was thrown in the compiler.
Please file a crash report here:
https://github.com/lampepfl/dotty/issues/new/choose
For non-enriched exceptions, compile with -Yno-enrich-error-messages.
while compiling: tests/pos/t6925.scala
during phase: Ycheck
mode: Mode(ImplicitsEnabled)
library version: version 2.13.12
compiler version: version 3.4.1-RC1-bin-SNAPSHOT-git-7bcfce2
settings: -Vprint List(typer) -Ycheck List(all) -classpath /Users/nicolasstucki/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar:/Users/nicolasstucki/Github/dotty/library/../out/bootstrap/scala3-library-bootstrapped/scala-3.4.1-RC1-bin-SNAPSHOT-nonbootstrapped/scala3-library_3-3.4.1-RC1-bin-SNAPSHOT.jar:/Users/nicolasstucki/Github/dotty/scala2-library-cc-tasty/../out/bootstrap/scala2-library-cc-tasty/scala-3.4.1-RC1-bin-SNAPSHOT-nonbootstrapped/scala2-library-cc-tasty_3-3.4.1-RC1-bin-SNAPSHOT.jar -d /
*** error while checking tests/pos/t6925.scala after phase typer ***
Exception in thread "main" java.lang.AssertionError: assertion failed: orphan param: xs.type, hash of binder = 1664998412, tree = <empty>, type = AnnotatedType(AppliedType(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class collection)),object immutable),trait Set),List(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),object scala),class Int))),ConcreteAnnotation(Apply(Select(New(Select(Select(Select(Ident(_root_),scala),annotation),retains)),<init>),List(Typed(SeqLiteral(List(This(Ident()), Ident(pf)),TypeTree[TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),object scala),Any)]),TypeTree[AppliedType(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),object scala),<repeated>),List(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),object scala),Any)))])))))
at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
at dotty.tools.dotc.transform.TreeChecker$$anon$2.apply(TreeChecker.scala:172)
at dotty.tools.dotc.core.Annotations$Annotation$$anon$1.apply(Annotations.scala:64)
... |
Minimization of class C:
def foo = Seq(5).map { i => i }
exception occurred while compiling List(tests/run/i4523.scala)
An unhandled exception was thrown in the compiler.
Please file a crash report here:
https://github.com/lampepfl/dotty/issues/new/choose
For non-enriched exceptions, compile with -Yno-enrich-error-messages.
while compiling: <no file>
during phase: parser
mode: Mode(ImplicitsEnabled)
library version: version 2.13.12
compiler version: version 3.4.1-RC1-bin-SNAPSHOT-git-7bcfce2
settings: -Ytest-pickler true -classpath /Users/nicolasstucki/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar:/Users/nicolasstucki/Github/dotty/library/../out/bootstrap/scala3-library-bootstrapped/scala-3.4.1-RC1-bin-SNAPSHOT-nonbootstrapped/scala3-library_3-3.4.1-RC1-bin-SNAPSHOT.jar:/Users/nicolasstucki/Github/dotty/scala2-library-cc-tasty/../out/bootstrap/scala2-library-cc-tasty/scala-3.4.1-RC1-bin-SNAPSHOT-nonbootstrapped/scala2-library-cc-tasty_3-3.4.1-RC1-bin-SNAPSHOT.jar -d /
Exception in thread "main" scala.MatchError: AppliedType(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class collection)),object immutable),Seq),List(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),object scala),Int))) (of class dotty.tools.dotc.core.Types$CachedAppliedType)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readPathTree$1(TreeUnpickler.scala:1239)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readSimpleTree$1(TreeUnpickler.scala:1309)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readTree(TreeUnpickler.scala:1556)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.$anonfun$33(TreeUnpickler.scala:1474)
at dotty.tools.tasty.TastyReader.until(TastyReader.scala:135)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readLengthTree$1(TreeUnpickler.scala:1474)
at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readTree(TreeUnpickler.scala:1556)
...
-Yprint-tasty output**** pickled info of class C
Header:
version: 28.5.1
tooling: Scala 3.4.1-RC1-bin-SNAPSHOT-git-7bcfce2
UUID: 00f7ab37-0348-1ec0-00f7-e5d0d668eb32
Names (399 bytes, starting from 64):
0: ASTs
1: <empty>
2: C
3: <init>
4: java
5: lang
6: java[Qualified . lang]
7: Object
8: java[Qualified . lang][Qualified . Object]
9: <init>[Signed Signature(List(),java.lang.Object) @<init>]
10: Unit
11: scala
12: foo
13: Seq
14: collection
15: scala[Qualified . collection]
16: immutable
17: scala[Qualified . collection][Qualified . immutable]
18: Int
19: annotation
20: scala[Qualified . annotation]
21: retains
22: scala[Qualified . annotation][Qualified . retains]
23: scala[Qualified . collection][Qualified . immutable][Qualified . Seq]
24: <init>[Signed Signature(List(scala.collection.immutable.Seq),scala.annotation.retains) @<init>]
25: _root_
26: Any
27: f
28: Function1
29: <repeated>
30: map
31: scala[Qualified . Function1]
32: map[Signed Signature(List(1, scala.Function1),java.lang.Object) @map]
33: apply
34: SeqOps
35: scala[Qualified . collection][Qualified . SeqOps]
36: apply[Signed Signature(List(1, scala.collection.immutable.Seq),scala.collection.SeqOps) @apply]
37: package
38: Delegate
39: SeqFactory
40: SeqFactory[ModuleClass]
41: IterableOps
42: $anonfun
43: i
44: SourceFile
45: internal
46: scala[Qualified . annotation][Qualified . internal]
47: scala[Qualified . annotation][Qualified . internal][Qualified . SourceFile]
48: String
49: java[Qualified . lang][Qualified . String]
50: <init>[Signed Signature(List(java.lang.String),scala.annotation.internal.SourceFile) @<init>]
51: tests/run/i4523.scala
52: Positions
53: Comments
54: Attributes
Trees (194 bytes, starting from 466):
0: PACKAGE(191)
3: TERMREFpkg 1 [<empty>]
5: TYPEDEF(186) 2 [C]
9: TEMPLATE(162)
12: APPLY(10)
14: SELECTin(8) 9 [<init>[Signed Signature(List(),java.lang.Object) @<init>]]
17: NEW
18: TYPEREF 7 [Object]
20: TERMREFpkg 6 [java[Qualified . lang]]
22: SHAREDtype 18
24: DEFDEF(7) 3 [<init>]
27: EMPTYCLAUSE
28: TYPEREF 10 [Unit]
30: TERMREFpkg 11 [scala]
32: STABLE
33: DEFDEF(138) 12 [foo]
37: ANNOTATEDtype(58)
39: APPLIEDtype(8)
41: TYPEREF 13 [Seq]
43: TERMREFpkg 17 [scala[Qualified . collection][Qualified . immutable]]
45: TYPEREF 18 [Int]
47: SHAREDtype 30
49: APPLY(46)
51: SELECTin(14) 24 [<init>[Signed Signature(List(scala.collection.immutable.Seq),scala.annotation.retains) @<init>]]
54: NEW
55: SELECTtpt 21 [retains]
57: SELECT 19 [annotation]
59: SELECT 11 [scala]
61: TERMREFpkg 25 [_root_]
63: TYPEREF 21 [retains]
65: TERMREFpkg 20 [scala[Qualified . annotation]]
67: TYPED(28)
69: REPEATED(18)
71: TYPEREF 26 [Any]
73: TERMREFpkg 11 [scala]
75: SHAREDtype 39
77: IDENT 27 [f]
79: APPLIEDtype(8)
81: TYPEREF 28 [Function1]
83: SHAREDtype 30
85: SHAREDtype 45
87: SHAREDtype 45
89: APPLIEDtype(6)
91: TYPEREF 29 [<repeated>]
93: SHAREDtype 73
95: SHAREDtype 71
97: APPLY(75)
99: TYPEAPPLY(47)
101: SELECTin(43) 32 [map[Signed Signature(List(1, scala.Function1),java.lang.Object) @map]]
104: APPLY(36)
106: TYPEAPPLY(18)
108: SELECTin(14) 36 [apply[Signed Signature(List(1, scala.collection.immutable.Seq),scala.collection.SeqOps) @apply]]
111: TERMREF 13 [Seq]
113: TERMREF 37 [package]
115: SHAREDtype 30
117: TYPEREF 38 [Delegate]
119: THIS
120: TYPEREF 40 [SeqFactory[ModuleClass]]
122: TERMREFpkg 15 [scala[Qualified . collection]]
124: SHAREDtype 45
126: TYPED(14)
128: REPEATED(4)
130: SHAREDtype 45
132: INTconst 5
134: APPLIEDtype(6)
136: TYPEREF 29 [<repeated>]
138: SHAREDtype 30
140: SHAREDtype 45
142: TYPEREF 41 [IterableOps]
144: SHAREDtype 122
146: SHAREDtype 45
148: BLOCK(24)
150: BLOCK(22)
152: LAMBDA(3)
154: TERMREFdirect 157
157: DEFDEF(15) 42 [$anonfun]
160: PARAM(3) 43 [i]
163: SHAREDtype 45
165: SHAREDtype 45
167: BLOCK(3)
169: TERMREFdirect 160
172: SYNTHETIC
173: ARTIFACT
174: ANNOTATION(18)
176: TYPEREF 44 [SourceFile]
178: TERMREFpkg 46 [scala[Qualified . annotation][Qualified . internal]]
180: APPLY(12)
182: SELECTin(8) 50 [<init>[Signed Signature(List(java.lang.String),scala.annotation.internal.SourceFile) @<init>]]
185: NEW
186: SHAREDtype 176
189: SHAREDtype 176
192: STRINGconst 51 [tests/run/i4523.scala]
194:
Positions (86 bytes, starting from 662):
lines: 4
line sizes:
0, 8, 33, 0
positions:
0: 1 .. 43
5: 1 .. 43
9: 12 .. 43
18: 7 .. 7
24: 12 .. 12
28: 12 .. 12
33: 12 .. 43
37: 19 .. 19
101: 22 .. 32
104: 22 .. 28
111: 22 .. 25
124: 22 .. 25
130: 27 .. 27
132: 26 .. 27
134: 27 .. 27
146: 22 .. 32
148: 33 .. 43
154: 41 .. 41
157: 35 .. 41
160: 35 .. 36
163: 36 .. 36
165: 36 .. 36
169: 40 .. 41
180: 1 .. 43
186: 1 .. 1
192: 1 .. 1
source paths:
0: 51 [tests/run/i4523.scala]
Attributes (2 bytes, starting from 752):
SOURCEFILEattr 51 [tests/run/i4523.scala]
**** end of pickled info of class C |
@Linyxus Could you take a look at the failures and see what can be done to fix them? |
Sure, I'll do that |
@Linyxus I will create a separate issue for each of the minimizations. This way discussions can be held on each individual issue. |
After fixing #19660, #19661 and #19662, we are left with the following issues:
I'll look into them. |
I minimised a issue that seems to be related to the runtime #19819, which I don't really know how to debug. /cc @nicolasstucki could you maybe have a look at this one? thanks! :) |
Only test a subset of tests that are known to currently work. [test_scala2_library_tasty] All `pos` tests work now. We will increase coverage to all tests once failures in #19652 (comment) are fixed.
Minimised another runtime-related issue #19845. |
#19603 fixes the basics and we can now compile most tests.
I tried to go further with
Here's the current list of failures:
We need to follow up on this next.
Originally posted by @odersky in #19586 (comment)
The text was updated successfully, but these errors were encountered: