object T:
class A
val a = new A : Int
end T
@main def m =
println(T.a)
This is with options:
scalacOptions ++= Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-unchecked",
"-Yindent-colons",
"-Ykind-projector",
"-language:strict",
"-source:3.1",
)
https://scastie.scala-lang.org/R2s6G90oTQ2ZcE6dn4ZlPg
T$A@5b61791c
Should not compile.
Would be good to get a solution as well! I am getting a bit tired of code obfuscation contests.
TBH this came up completely by accident (I was not trying to expose a problem), in my real-world code base, and I have no idea what's going on. Seems like this is a parser bug.
this only passes for me when using -Yindent-colons, the parser drops the type ascription
Most helpful comment
this only passes for me when using
-Yindent-colons, the parser drops the type ascription