Less general type

This commit is contained in:
Vic Nightfall 2023-09-01 12:51:06 +02:00
parent fb7b51a971
commit 3c43978c55

View File

@ -32,12 +32,13 @@ public class OverloadPattern {
return x * y;
}
Object m(Point point) {
Number m(Point point) {
switch(point) {
case Point(Integer x, Integer y) ->
m$Point$_$java$lang$Integer$_$java$lang$Integer$_$(point);
case Point(Float x, Float y) ->
m$Point$_$java$lang$Float$_$java$lang$Float$_$(point);
default -> throw new IllegalArgumentException();
}
}