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
[toolbox] IndexOutOfBoundsException from StandardImporter.recreateOrRelink #9218
Comments
Imported From: https://issues.scala-lang.org/browse/SI-9218?orig=1 |
@retronym said: I would recommend to add a better diagnostic message in that part of |
Jerzy Muller (keros) said: public <T> T genericMethod(T x) {
return x;
} I'll try to debug the cause of this later, it have to be some corrupted state in Toolbox, as running this test alone works fine. |
Here's a standalone reproduction of a bug with the same symptom.
The code creates the new class symbol for This is minimized from fthomas/refined#3
.. a bug which still has a workaround in The error goes away sometime between Scala 2.12.0-M3 and 2.12.0-M4. The biggest change to land in that time is the new trait encoding. I don't see relevant changes to |
Something like: diff --git a/src/reflect/scala/reflect/internal/Importers.scala b/src/reflect/scala/reflect/internal/Importers.scala
index 494f62af06..b2b0ebe551 100644
--- a/src/reflect/scala/reflect/internal/Importers.scala
+++ b/src/reflect/scala/reflect/internal/Importers.scala
@@ -78,6 +78,13 @@ trait Importers { to: SymbolTable =>
}
my setInfo GenPolyType(mytypeParams, importType(theirCore))
my setAnnotations (their.annotations map importAnnotationInfo)
+ their match {
+ case _: ClassSymbol =>
+ if (their.thisSym != their) {
+ my.typeOfThis = importType(their.typeOfThis)
+ my.thisSym setName importName(their.thisSym.name)
+ }
+ }
markAllCompleted(my)
}
}
@@ -124,10 +131,6 @@ trait Importers { to: SymbolTable =>
case their: from.ClassSymbol =>
val my = myowner.newClassSymbol(myname.toTypeName, mypos, myflags)
symMap.weakUpdate(their, my)
- if (their.thisSym != their) {
- my.typeOfThis = importType(their.typeOfThis)
- my.thisSym setName importName(their.thisSym.name)
- }
my.associatedFile = their.associatedFile
my
case their: from.TypeSymbol =>
seems better to me. |
I encounter something similar in a macro expansion:
But if compiled with bloop & metals this problem disappeared. Have you tried the same? |
Unfortunately no minimal right now, as this appears only when I run a whole test suite - on single test it works ok.
Failing test is in expression evaluator PR for Scala IDE (https://github.com/scala-ide/scala-ide/pull/906/files#diff-2dbb5006e81b31769258a37f8cc7016eR50)
Stack trace:
The text was updated successfully, but these errors were encountered: