4 ms·
One question about sealed: Does anyone know how it will play with type parameters in the interface? I know in Scala, you can simulate GADTs with that. sea
by whateveracct 7y ago
One question about sealed:
Does anyone know how it will play with type parameters in the interface? I know in Scala, you can simulate GADTs with that.
sealed interface Expr<A> {}
record IntExpr(Integer i) implements Expr<Integer> { }
record StringExpr(String i) implements Expr<String> { }
Will that be legal? And will switch be able to do its magic and carry that type variable through?