4 public function get(): T
;
7 class A
implements I
<int>, I
<num
> {
8 public function get(): int {
19 // Using T here is not an error, but a bug in Decl_linearize caused us to
20 // consider it to be one. When checking that B satisfies its requirements,
21 // instead of verifying only that B extends A, we verified that B was
22 // compatibile with A and *also* all of A's ancestors (I<int> and I<num>).
23 // When a class like A implements a generic interface with multiple
24 // parameterizations, we arbitrarily select the first as canonical, so A and B
25 // implement I<int> and NOT I<num> from the perspective of the typechecker.
26 // Since I is invariant in its type parameter, when we attempt to verify that
27 // B <: I<num>, we emit an error.
29 // We should probably not allow classes like A, but we seem to have many in