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

Error in Scala compiler: unexpected opening parenthesis #8704

Closed
scabug opened this issue Jul 2, 2014 · 4 comments
Closed

Error in Scala compiler: unexpected opening parenthesis #8704

scabug opened this issue Jul 2, 2014 · 4 comments

Comments

@scabug
Copy link

scabug commented Jul 2, 2014

think I've found the smallest piece of code that chokes the compiler!

class A(implicit a: A)()
@scabug
Copy link
Author

scabug commented Jul 2, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8704?orig=1
Reporter: Krasimir Georgiev (comco)
Affected Versions: 2.11.1

@scabug
Copy link
Author

scabug commented Jul 3, 2014

@som-snytt said:
You can make it shorter by leaving off the closing paren.

scala.reflect.internal.FatalError: unexpected opening parenthesis

Because of the implicit, it stopped consuming param lists.

@scabug
Copy link
Author

scabug commented Sep 29, 2015

@som-snytt said:
Previously,

Welcome to Scala version 2.9.3 (OpenJDK 64-Bit Server VM, Java 1.6.0_34).
Type in expressions to have them evaluated.
Type :help for more information.

scala> def f = { class C(protected implicit val s: String, i: Int) () }
f: Unit

scala> def f = { class C(implicit s: String)
     | () }
<console>:2: error: traits or objects may not have parameters
       () }
       ^

but now

scala> def f = { class C(implicit s: String)
     | new C()("c") }
f: AnyRef

scala> def f = { class C(implicit s: String)
     | () }
ReplGlobal.abort: unexpected opening parenthesis

@scabug
Copy link
Author

scabug commented Dec 8, 2016

@som-snytt said:
scala/scala#5585

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