Parser error for infix methods with type parameter.
See original GitHub issueFrom @durban on February 4, 2016 12:15
The code below produces this message:
[warn] Scalariform parser error for .../GenericOperator.scala: Expected token SEMI but got Token(LBRACKET,[,83,[)
The error seems to be caused by the C() ?[Int] 7
expression; without the [Int]
, there is no error.
object GenericOperator {
case class C() {
def ?[A](a: A): A = a
}
C() ?[Int] 7
}
Copied from original issue: daniel-trinh/scalariform#111
Issue Analytics
- State:
- Created 8 years ago
- Comments:6
Top Results From Across the Web
Chaining infix operators with statically resolved type parameter
I'm trying to create an infix operator to make System.Text.StringBuilder slightly easier to use. ... but fails with parameters of different types:
Read more >Calling a function without parameters in infix notation - Question
Parsing precedes type checking. a b c is always parsed as a.b(c) , regardless of what types are involved. Note also that the...
Read more >Troubleshooting F# | F# for fun and profit
This error typically occurs when passing too many arguments to a function. It can also occur when you do operator overloading, but the...
Read more >Infix Notation : Kotlin - Suneet Agrawal
But infix functions always require both the receiver and the parameter to be specified. When you are calling a method on the current...
Read more >SML/NJ Error Messages
The parser used by SML/NJ is produced by ML-Yacc, and it uses a lexer ... fun f = 3; stdIn:1.5 Error: can't find...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Any update on this?
Hello,
I got a similar error message (as reported in #217) with scalastyle:
On the following block:
I fixed it by removing the trailing comma at the end of the
copy
call.