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

val 1 = 2 and other value declarations that don't declare any values confuse the REPL #4950

Closed
scabug opened this issue Aug 29, 2011 · 6 comments
Assignees
Labels
Milestone

Comments

@scabug
Copy link

scabug commented Aug 29, 2011

Welcome to Scala version 2.9.1.RC4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26).
Type in expressions to have them evaluated.
Type :help for more information.

scala> { val 1 = 2 }
scala.MatchError: 2 (of class java.lang.Integer)

scala> val 1 = 2

the latter should be an error too

#4939 was closed as wontfix, but this is just the REPL piece of it, which really is a bug

@scabug
Copy link
Author

scabug commented Aug 29, 2011

Imported From: https://issues.scala-lang.org/browse/SI-4950?orig=1
Reporter: @SethTisue

@scabug
Copy link
Author

scabug commented Jun 25, 2012

@retronym said:
Another example from #5855:

scala> val List(1) = List(1)
<console>:5: error: value x$1 is not a member of object $iw
  lazy val $result = `x$1`

@scabug
Copy link
Author

scabug commented Oct 23, 2014

@soc said:
Scala 2.11.1:

scala> val 1 = 2
scala.MatchError: 2 (of class java.lang.Integer)
  ... 32 elided
scala> val List(1) = List(1)

scala> 

Is there anything else expected here?

Otherwise, I'd write a PR which adds tests and close this issue.

@scabug
Copy link
Author

scabug commented Oct 23, 2014

@retronym said:
Thanks, that is the right course of action. I think this progressed during 2a1d020..3292c4a (we are missing a few builds in the scala-bisect repo to quickly determine exactly which commit fixed it.)

@scabug
Copy link
Author

scabug commented Oct 23, 2014

@soc said:
Ok, I'm on it!

@scabug
Copy link
Author

scabug commented Oct 23, 2014

@soc said:
scala/scala#4072

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants