Skip to content

A new contender for the title of Shortest Compiler Slayer #10731

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

Closed
sir-wabbit opened this issue Feb 17, 2018 · 5 comments
Closed

A new contender for the title of Shortest Compiler Slayer #10731

sir-wabbit opened this issue Feb 17, 2018 · 5 comments
Assignees
Milestone

Comments

@sir-wabbit
Copy link

sir-wabbit commented Feb 17, 2018

val eq.a=1

Found thanks to @emilypi (most credit goes to her)

Tested in 2.13.0-M3 REPL

@som-snytt
Copy link

som-snytt commented Feb 17, 2018

That's a good one, but there are some caveats that figure into how the judges score the routine.

The shortest crasher has to be a compilation unit, not a snippet. Yes, that's a high bar.

Also, points are deducted for crashes landing in RefChecks, which are less highly esteemed than actual typechecking bugs.

Leaking erroneous trees has a long and storied history, e.g., #4425, reported by propensive, who happens to hold the shortest crasher title.

Just as they added ice dancing and synchronized swimming to the Olympics, scala center might be persuaded to award the fastest crasher, as measured by the new compiler statistics. That would probably happen in parser, however. Crashes in linting are strictly disallowed as they are not a true compiler sport, much like a gold medal in baseball or tennis.

Error recovery is challenging for a compiler, but scalac feels so bad about telling you that your program can't work, it prefers to procrastinate about giving you the bad news. In some cases, the compiler will just go on compiling for hours rather than see the look on your face when it can't find an implicit and you have no idea what import is missing.

@hrhino hrhino modified the milestones: Backlog, 2.12.5 Feb 18, 2018
@som-snytt
Copy link

I did just receive a certificate from scala center for shortest fix for a short compiler slayer.

I was hoping for a coupon at the scala store...

@SethTisue
Copy link
Member

PR: scala/scala#6334

@SethTisue
Copy link
Member

SethTisue commented Feb 24, 2018

I've seen it asked several times now if this is valid syntax. it is; it's a pattern match. demonstration:

Welcome to Scala 2.12.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_162).
Type in expressions for evaluation. Or try :help.

scala> object a { val b = 3 }
defined object a

scala> val a.b = 4
scala.MatchError: 4 (of class java.lang.Integer)
  ... 28 elided

scala> val a.b = 3

adriaanm pushed a commit to som-snytt/scala that referenced this issue Mar 9, 2018
The result could never be stable...

TODO: better error message

Tests for scala/bug#10474, scala/bug#10731
adriaanm pushed a commit to som-snytt/scala that referenced this issue Mar 9, 2018
A method is not a value, and thus must somehow be converted
to an expression -- unless we're specifically looking for a method.

We can either insert an application (to implicit args or empty arg list),
or lift to a function by eta-expansion. If those are not possible,
we report an error (unstable tree -- could be refined further).

Tests for scala/bug#10474, scala/bug#10731
@lrytz
Copy link
Member

lrytz commented Mar 12, 2018

Fixed in scala/scala#6273

@lrytz lrytz closed this as completed Mar 12, 2018
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

5 participants