Skip to content
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

StackOverflow in generic array instantiation without a classtag under an Assign #9401

Closed
scabug opened this issue Jul 16, 2015 · 3 comments
Closed
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Jul 16, 2015

% git log --oneline  ca9f64d~7 -2
725c5c9 Encapsulate reporting mode as class of reportBuffer.
f0fdcc0 Clarify that ThrowErrors is the default

% scalac-hash f0fdcc0 test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/Resetting.scala
test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/Resetting.scala:3: error: cannot find class tag for element type T
  gencastarray = new Array[T](0)
                 ^
one error found

% scalac-hash 725c5c9 test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/Resetting.scala 2>&1 | head -n 10
error: java.lang.StackOverflowError
        at scala.reflect.internal.Types$SimpleTypeProxy$class.boundSyms(Types.scala:153)
        at scala.reflect.internal.Types$SingletonType.boundSyms(Types.scala:1076)
        at scala.reflect.internal.tpe.TypeMaps$SubstMap.apply(TypeMaps.scala:698)
        at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:110)
        at scala.reflect.internal.tpe.TypeMaps$SubstMap.apply(TypeMaps.scala:700)
        at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:148)
        at scala.reflect.internal.tpe.TypeMaps$SubstMap.apply(TypeMaps.scala:700)
        at scala.reflect.internal.Types$Type.subst(Types.scala:705)
        at scala.reflect.internal.Types$Type.instantiateTypeParams(Types.scala:470)

%  cat test/benchmarks/src/scala/collection/parallel/benchmarks/arrays/Resetting.scala
class Resetting[T] {
  var gencastarray: Any = null
  gencastarray = new Array[T](0)
}
@scabug
Copy link
Author

scabug commented Jul 16, 2015

Imported From: https://issues.scala-lang.org/browse/SI-9401?orig=1
Reporter: @retronym
Affected Versions: 2.11.3
See #6685

@scabug
Copy link
Author

scabug commented Jul 16, 2015

@retronym said:
Looks like the situation before this commit was pretty messed up: if we enabling -Ytyper-debug we actually SOE as well. This suggests that we are catching and recovering from the SOE elsewhere. All if which is pretty reminiscent of #6685 (which was probably worth it for the classic "I feel like showering with lye." reaction: scala/scala#1684

Diffing the -Ytyper-debug output from the before and after revisions above yields: https://gist.github.com/retronym/d5c4e292749fe97ae7e2

/cc [~xeno.by]

@scabug
Copy link
Author

scabug commented Jul 16, 2015

@retronym said:
scala/scala#4637

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants