Open scabug opened 10 years ago
Imported From: https://issues.scala-lang.org/browse/SI-8859?orig=1 Reporter: @retronym Affected Versions: 2.11.2
@retronym said: Here's how I believe we can fix this: https://github.com/retronym/scala/compare/ticket/8859?expand=1
@gkossakowski said: Jason, would be feasible to have JUnit tests for this issue?
@retronym said (edited on Sep 24, 2014 12:59:03 PM UTC): The test in my prototype doesn't depend on any particular features of partest, so that would be possible.
The bigger question in my mind is whether the introduction of the new, transient AST node Braces
is the simplest solution to the bug.
@gkossakowski said: I haven't looked at it in detail. I'll try to look into that over the weekend (before that I'm busy preparing for reactive streams workshop I'm giving).
@dwijnand said:
If this were fixed it would help sbt's performance, as currently *.sbt
files are parsed twice:
Possibly related:
object Foo {
def apply(t : Any)(block: => Unit) : Unit = {}
def foo(t : Any)(block: => Unit) : Unit = {}
}
object Test {
Foo(1){} //OK
Foo foo(1) {} //Error: Int(1) does not take parameters
Foo.foo(1) {} //OK
}
Where the applications are parsed as:
Foo(1)(());
Foo.foo(1(()));
Foo.foo(1)(())
I created a scastie link with the error and parser printing.
I think the error is correct, as it's InfixExpr id SimpleExpr
where the simple is Simple Args
.
The example also looks good this way:
Foo foo ("abc")
{
1
}
// missing argument list for method foo in object Foo
Are they still making puzzlers?
There's a related (edit: or not) position ticket https://github.com/scala/bug/issues/12074
I was just grepping for a good example of a confusing "does not take parameters", because there is a dotty ticket about how helpful an error message should be. -Yreporter:french-waiter
.
As discovered and investigated by [~ajozwik]: https://github.com/scala/scala/pull/3991