Skip to content

Commit fa151e2

Browse files
committed
Main.scala: Update union types usage
A method called on a union type has to be present in the supertype of the union since scala/scala3#1550
1 parent 363d8e2 commit fa151e2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: src/main/scala/Main.scala

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
class A {
1+
trait Base {
2+
def message: String
3+
}
4+
class A extends Base {
25
def message: String = "Hello"
36
}
4-
class B {
7+
class B extends Base {
58
def message: String = "Dotty!"
69
}
710

0 commit comments

Comments
 (0)