streetsofboston
06/17/2020, 7:54 PMd1
like this makes it a proper singleton (type === value) and your error goes away.
object d1 : java.util.Date() { // d1 is of type d1, which is a sub-type of java.util.Data
val test = 5
}
Still, why would a local val allows access to test
but a top/global one not…. not sure đŸ™‚Zach Klippenstein (he/him) [MOD]
06/17/2020, 9:13 PMclass Test {
public void test() {
new Date() {
public String fooBar() {
return "foo bar";
}
}.fooBar();
}
}
Zach Klippenstein (he/him) [MOD]
06/17/2020, 9:14 PMstreetsofboston
06/17/2020, 9:39 PM