-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Dotty compiler crashes with StackOverflowError on symbol literal #2960
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
Comments
Does it crash using If so, this is not a REPL issue, which would be greeeeeeeeeeeat, because we're throwing the current REPL out next week. |
@felixmulder Oh,you right. I try to add main method to the project: import org.glavo.dotty._
import org.glavo.dotty.Tag._
object Main {
def main(args: Array[String]): Unit = {
'html {}
}
}
|
"yay"! :) |
Here is a minimised version of the code: object Main {
implicit def symbolToTag(symbol: Symbol): Tag = new Tag
def main(args: Array[String]): Unit = {
'html {}
}
}
class Tag {
def apply(attrs: (String, String)*): this.type = this
def apply(f: implicit Tag => Int)(implicit t: Tag = null): this.type = this
} |
Here is a simpler one, but the stack trace is different: object Main {
implicit def symbolToTag(symbol: Symbol): Tag = new Tag
def main(args: Array[String]): Unit = {
'html {}
}
}
class Tag {
def apply(attrs: (String, String)*): this.type = this
def apply(implicit t: Tag = null): this.type = this
} Maybe not the same issue? |
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 8, 2017
This fix prevents infinite chains of inserted apply's. Fixes scala#2960.
smarter
added a commit
that referenced
this issue
Aug 16, 2017
Fix #2960: Only allow one inserted apply per tree
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I compiled with sbt, and run sbt task 'console':
The text was updated successfully, but these errors were encountered: