dartc fails test on implementing 2 generics #2495
Labels
closed-duplicate
Closed in favor of an existing report
legacy-area-analyzer
Use area-devexp instead.
Milestone
This issue was originally filed by [email protected]
dartc is failing this test: Language/13_Types/4_Interface_Types_A11_t04.dart
/**
* @assertion A type T is more specific than a type S, written T << S, if T << U and U << S.
* << is a partial order on types. T is a subtype of S, written T <: S, iff [⊥/Dynamic]T << S.
* A type T may be assigned to a type S, written T <=> S, if either T <: S or S <: T .
* @description Checks that if type T is a subtype of S1 and S2 where S1 <: S<G1> and S2 <: S<G2> then
* T is a subtype of S<G1> as well as S<G2> and every other supertype of S.
* @author iefremov
* @reviewer rodionov
*/
interface S<T> {}
interface S1 extends S<int> {}
interface S2 extends S<double> {}
class T implements S1, S2 {}
main() {
Expect.isTrue(new T() is S<int>);
Expect.isTrue(new T() is S<double>);
Expect.isTrue(new T() is S<num>);
Expect.isTrue(new T() is S<Object>);
Expect.isTrue(new T() is S);
}
it gives this error:
$ dartc tests/co19/src/Language/13_Types/4_Interface_Types_A11_t04.dart
file:/home/zundel/dart-all/dart/tests/co19/src/Language/13_Types/4_Interface_Types_A11_t04.dart:17: Type variable 'T' is hiding 'CLASS T' at 4_Interface_Types_A11_t04.dart:T:23:7
16:
17: interface S<T> {}
file:/home/zundel/dart-all/dart/tests/co19/src/Language/13_Types/4_Interface_Types_A11_t04.dart:23: S<int> and S<double> are duplicated in the supertype graph
22:
23: class T implements S1, S2 {}
The text was updated successfully, but these errors were encountered: