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

Typo in for expr crashes, = instead of <-, NoPosition is pointless #7473

Closed
scabug opened this issue May 12, 2013 · 2 comments
Closed

Typo in for expr crashes, = instead of <-, NoPosition is pointless #7473

scabug opened this issue May 12, 2013 · 2 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented May 12, 2013

Oops, I did it again. Butter fingers!

Instead of crashing, I'd propose a message like, "I'll bring the popcorn!"

apm@mara:~$ skala
Welcome to Scala version 2.11.0-20130422-021742-1d54f26b9a (OpenJDK 64-Bit Server VM, Java 1.7.0_21).
Type in expressions to have them evaluated.
Type :help for more information.

scala> val i = 3
i: Int = 3

scala> val j = 3
j: Int = 3

scala> (for (x = Option(i); if x == j) yield 42) toList
<console>:1: error: '<-' expected but '=' found.
       (for (x = Option(i); if x == j) yield 42) toList
               ^
<console>:1: error: illegal start of simple expression
       (for (x = Option(i); if x == j) yield 42) toList
                          ^
java.lang.UnsupportedOperationException: Position.point on class scala.reflect.internal.util.NoPosition$
	at scala.reflect.internal.util.Position.point(Position.scala:115)
	at scala.reflect.internal.util.Position.startOrPoint(Position.scala:112)
	at scala.tools.nsc.ast.parser.Parsers$Parser.postfixExpr(Parsers.scala:1444)
	at scala.tools.nsc.ast.parser.Parsers$Parser.parseOther$1(Parsers.scala:1339)
	at scala.tools.nsc.ast.parser.Parsers$Parser.expr0(Parsers.scala:1393)
	at scala.tools.nsc.ast.parser.Parsers$Parser.expr(Parsers.scala:1235)

Also in 2.10.1. Is NoPosition the new NoSymbol has no owner?

@scabug
Copy link
Author

scabug commented May 12, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7473?orig=1
Reporter: @som-snytt
Affected Versions: 2.10.1
See #7385

@scabug
Copy link
Author

scabug commented May 23, 2013

@som-snytt said:
scala/scala#2583

@scabug scabug closed this as completed May 30, 2013
@scabug scabug added the quickfix label Apr 7, 2017
@scabug scabug added this to the 2.10.3-RC1 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants