Unexpected compilation error with generic sealed interface

Mark Raynsford mark at io7m.com
Mon Dec 28 10:33:03 UTC 2020


On 2020-12-27T23:40:50 +0100
Remi Forax <forax at univ-mlv.fr> wrote:

> Hi Mark,
> this is an interesting snippet, while i struggle to understand why someone want to write a code like that, I is parametrized by T but the only possible subclass implements I<Object> so T is useless here,
> anyway, the compiler should not reject that code so it's a bug.

Hello!

I think the original code was a collection of little functional data
structures (Option, List, etc) to try out the combination of records
and sealed classes.

The code above is the result of removing things one by one until the
result was a minimal example that would trigger the error.

-- 
Mark Raynsford | https://www.io7m.com



More information about the amber-spec-experts mailing list