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

Inner object called $ causes compiler crash #6888

Closed
scabug opened this issue Dec 28, 2012 · 12 comments
Closed

Inner object called $ causes compiler crash #6888

scabug opened this issue Dec 28, 2012 · 12 comments

Comments

@scabug
Copy link

scabug commented Dec 28, 2012

Compiling the following is enough to cause the compiler to crash:

class X { object $ }

Full stack trace from Scala 2.10.0-RC5 attached.

@scabug
Copy link
Author

scabug commented Dec 28, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6888?orig=1
Reporter: @propensive
Affected Versions: 2.10.0-M3, 2.10.0-RC5
See #2806
Attachments:

  • stacktrace (created on Dec 28, 2012 10:54:40 AM UTC, 20723 bytes)

@scabug
Copy link
Author

scabug commented Dec 28, 2012

@JamesIry said:
17 character crasher. Impressive.

@scabug
Copy link
Author

scabug commented Dec 28, 2012

@JamesIry said (edited on Dec 28, 2012 5:44:38 PM UTC):
But I've got you beat by one character, sorry Jon

class X{class $}

@scabug
Copy link
Author

scabug commented Dec 28, 2012

@propensive said:
Daniel Spiewak managed one better!

class+{class $}

@scabug
Copy link
Author

scabug commented Dec 31, 2012

@paulp said:
When you have to use '$', it's not a bug. I'm glad it fails fast.

You guys can only find these weak 15+ character crashers. I guess I found all the four character crashers years ago... #1215

@scabug
Copy link
Author

scabug commented Dec 31, 2012

@propensive said:
My original use-case was for string interpolation on a dollar-prefixed string, e.g.

val money = $"100.00"

which, given the paucity of spare symbols on my keyboard, seems reasonable to me (bearing in mind I'm selfish)... ;)

And I'm sadly not allowed this either:

val money = £"100.00"

@scabug
Copy link
Author

scabug commented Jan 23, 2013

@adriaanm said:
Sorry, dollar is out of reach unfortunately.

@scabug
Copy link
Author

scabug commented Jan 24, 2013

@propensive said:
Incidentally,

class X { object  }

works just fine...

But seriously, given that a) this is really really easy to reproduce and b) a compiler crash surely can't be the right answer, can we reopen the issue until someone is prepared to fix it?

@scabug
Copy link
Author

scabug commented Jan 24, 2013

@paulp said:
Yes, a compiler crash is never the right answer.

@scabug
Copy link
Author

scabug commented Feb 5, 2013

@retronym said:
scala/scala#2069

@scabug
Copy link
Author

scabug commented Feb 8, 2013

@JamesIry said:
Leaving open for the broader issue of name hygiene

@scabug
Copy link
Author

scabug commented Feb 8, 2013

@JamesIry said:
NVM, #2806 covers that

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