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

Compiler crash in GenICode after using implicit def XX to add overloaded * to enriched Int. #1832

Closed
scabug opened this issue Mar 27, 2009 · 9 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Mar 27, 2009

After trying to compile the code below the compiler crashed with the exception in GenICode$$ICodePhase.genLoadArguments. Tried both on 2.7.3final and 2.8.0.r17382 - same results. See the call stack below.

// Edit by paulp: reduced.
trait Cloning {
  trait Foo
  def fn(g: Any => Unit): Foo
  
  implicit def mkStar(i: Int) = new { def *(a: Foo): Foo = null }

  val pool = 4 * fn { case iii: Int => iii * 2 }
}
# scalac Swarm.scala
Exception in thread "main" java.lang.Error: symbol value iii$$1 does not exist in playground.Swarm.main
	at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.scala$$tools$$nsc$$backend$$icode$$GenICode$$ICodePhase$$$$genLoad(GenICode.scala:912)
	at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.genLoadArguments(GenICode.scala:1103)
@scabug
Copy link
Author

scabug commented Mar 27, 2009

Imported From: https://issues.scala-lang.org/browse/SI-1832?orig=1
Reporter: Szymon Jachim (sjachim)

@scabug
Copy link
Author

scabug commented Mar 29, 2009

@paulp said:
I think this is related to #1110, a bug which looked easy to fix but when I tried a while back I did not succeed. Notice that if you use a name like "foo" instead of "*" it compiles okay.

@scabug
Copy link
Author

scabug commented Mar 29, 2009

Szymon Jachim (sjachim) said:
Also if i move the actor { ... } call to a separate val proto definition and than just do 4 * proto it also works :-|

  val proto = actor {   ...   }
  val pool = 4 * proto

Might me a useful hint.

@scabug
Copy link
Author

scabug commented Apr 21, 2009

@dubochet said:
I don't know what that bug is. Could it have been assigned to me by mistake?

@scabug
Copy link
Author

scabug commented Apr 21, 2009

@paulp said:
I think it was assigned to you because I speculated above that it is related to #1110, and that because this bug also is triggered only when one uses a method name which is shared by the name of a primitive operation.

On closer inspection I don't think they're related except inasmuch as the platonically ideal fix to both bugs would likely involve some shared machinery for dealing with the issue.

@scabug
Copy link
Author

scabug commented Apr 22, 2009

@dragos said:
It's a bug in the pattern matcher, there's no definition of iii after pattern expansion.

@scabug
Copy link
Author

scabug commented Jul 20, 2012

@adriaanm said:
nope, it's a bug in the type checker, in typedBind, more precisely --> scala/scala#958

@scabug
Copy link
Author

scabug commented Jul 20, 2012

@paulp said:
Wow, you got this one? You are on an epic tear.

@scabug
Copy link
Author

scabug commented Jul 20, 2012

@adriaanm said (edited on Jul 20, 2012 9:59:22 PM UTC):
Og inspired me. Just mutate.

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

2 participants