Closed
Description
Minimized code
class X
object X {
extension (x: List[X]) { def isNull = x.head == null }
}
@main def test = List(null: X).isNull
https://scastie.scala-lang.org/He9Pm96ySZCBCziHLktlXg
Output
Error:
Found: X
Required: Any*
Expectation
Should compile. If a redundant second set of parentheses is added in List((null: X))
, then the example compiles:
class X
object X {
extension (x: List[X]) { def isNull = x.head == null }
}
@main def test = List((null: X)).isNull