-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
area:experimental:modularityIssues related to the modularity extension.Issues related to the modularity extension.itype:bug
Description
Compiler version
3.5.0-RC4
Minimized code
//> using options -source:future -language:experimental.modularity
enum Foo(tracked val discriminator: String):
case Bar() extends Foo("bar")
case Baz() extends Foo("baz")
val bar: Foo = Foo.Bar()
@main def test = println(bar.discriminator)
Output
running main method test:
java.lang.AbstractMethodError: Receiver class rs$line$1$Foo$Bar does not define or inherit an implementation of the resolved method 'java.lang.String discriminator()' of abstract class rs$line$1$Foo. Selected method is 'abstract java.lang.String rs$line$1$Foo$Bar.discriminator()'.
at rs$line$1$.test(rs$line$1:6)
... 32 elided
Expectation
I expected to run the method, and have it return a widened type, not a crash
Metadata
Metadata
Assignees
Labels
area:experimental:modularityIssues related to the modularity extension.Issues related to the modularity extension.itype:bug