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

2.getClass() == 4.getClass() crashes the compiler #5026

Closed
scabug opened this issue Sep 25, 2011 · 6 comments
Closed

2.getClass() == 4.getClass() crashes the compiler #5026

scabug opened this issue Sep 25, 2011 · 6 comments
Assignees

Comments

@scabug
Copy link

@scabug scabug commented Sep 25, 2011

2.getClass() == 4.getClass() causes the compiler (or repl) to crash.

I also tried 2.getClass() != 4.getClass(), which crashes, and 2.getClass().equals(4.getClass()), which does not crash.

java.lang.UnsupportedOperationException: Position.line
at scala.tools.nsc.util.Position$class.line(Position.scala:173)
at scala.tools.nsc.util.NoPosition$.line(Position.scala:196)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.getTempLocal$1(GenICode.scala:1562)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genEqEqPrimitive(GenICode.scala:1614)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genRefEq$1(GenICode.scala:1516)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genCond(GenICode.scala:1527)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genPrimitiveOp(GenICode.scala:441)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:902)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genStat(GenICode.scala:163)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genStat$1.apply(GenICode.scala:143)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genStat$1.apply(GenICode.scala:143)
at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:111)
at scala.collection.immutable.List.foldLeft(List.scala:45)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genStat(GenICode.scala:143)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1052)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:114)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:69)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:69)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:69)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:136)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:88)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:69)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:69)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:69)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:79)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:65)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.apply(GenICode.scala:61)
at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:329)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:297)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:297)
at scala.collection.Iterator$class.foreach(Iterator.scala:660)
at scala.collection.mutable.ListBuffer$$anon$1.foreach(ListBuffer.scala:316)
at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:297)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.run(GenICode.scala:54)
at scala.tools.nsc.Global$Run.compileSources(Global.scala:953)
at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compileAndSaveRun(IMain.scala:756)
at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compile(IMain.scala:731)
at scala.tools.nsc.interpreter.IMain$Request.compile(IMain.scala:873)
at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:576)
at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:543)
at scala.tools.nsc.interpreter.ILoop.reallyInterpret$1(ILoop.scala:694)
at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:745)
at scala.tools.nsc.interpreter.ILoop.command(ILoop.scala:651)
at scala.tools.nsc.interpreter.ILoop.processLine$1(ILoop.scala:542)
at scala.tools.nsc.interpreter.ILoop.loop(ILoop.scala:550)
at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:822)
at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:67)
at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:80)
at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:89)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Sep 25, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5026?orig=1
Reporter: Karl Voelker (ktvoelker)

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Sep 26, 2011

Commit Message Bot (anonymous) said:
(extempore in r25726) Stripped a bunch of hostile code.

Closes #5026, no review.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Apr 22, 2012

Eric Tanter (etanter) said:
This bug is still present in release 2.9.1

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Apr 22, 2012

Eric Tanter (etanter) said:
This bug is still present in 2.9.1
(I'm on mac os x)

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Apr 23, 2012

@kzys said (edited on Apr 23, 2012 2:26:33 AM UTC):
Yeah, it still exists on 2.9.1-1.

% scala
Welcome to Scala version 2.9.1-1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_31).
Type in expressions to have them evaluated.
Type :help for more information.
scala> 2.getClass() == 4.getClass()
java.lang.UnsupportedOperationException: Position.line        at scala.tools.nsc.util.Position$class.line(Position.scala:173)
        at scala.tools.nsc.util.NoPosition$.line(Position.scala:196)
...

But I can't reproduce it on 8c95273b70288e4e3a547fa43f2dbdb40a71b9ea.

% ./build/pack/bin/scala
Welcome to Scala version 2.10.0-20120422-061223-8c95273b70 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_31).
Type in expressions to have them evaluated.
Type :help for more information.

scala> 2.getClass() == 4.getClass()
res0: Boolean = true

scala> 2.getClass() != 4.getClass()
res1: Boolean = false

scala> 2.getClass().equals(4.getClass())
res2: Boolean = true

scala> 
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Apr 23, 2012

Eric Tanter (etanter) said:
ok, good to know. Sorry for the noise!

@scabug scabug closed this Apr 23, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.