mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 03:56:57 +00:00
Applying a mixin replaces corresponding names in the interface.
Change-Id: I5e2ada71af50aa580f5d236773ccb122fca5591c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143060 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
parent
2854d6f4c0
commit
450ae848f6
|
@ -106,20 +106,12 @@ class InheritanceManager3 {
|
|||
Map<Name, ExecutableElement> declared;
|
||||
Interface superInterface;
|
||||
Map<Name, ExecutableElement> implemented;
|
||||
List<List<Conflict>> mixinsConflicts = [];
|
||||
try {
|
||||
// If a class declaration has a member declaration, the signature of that
|
||||
// member declaration becomes the signature in the interface.
|
||||
declared = _getTypeMembers(type);
|
||||
|
||||
for (var interface in type.interfaces.reversed) {
|
||||
var interfaceObj = getInterface(interface);
|
||||
_addCandidates(
|
||||
namedCandidates,
|
||||
interfaceObj,
|
||||
isNonNullableByDefault: isNonNullableByDefault,
|
||||
);
|
||||
}
|
||||
|
||||
if (classElement.isMixin) {
|
||||
var superClassCandidates = <Name, List<ExecutableElement>>{};
|
||||
for (var constraint in type.superclassConstraints) {
|
||||
|
@ -162,13 +154,69 @@ class InheritanceManager3 {
|
|||
implemented = {};
|
||||
}
|
||||
|
||||
// TODO(scheglov) Handling of members for super and mixins is not
|
||||
// optimal. We always have just one member for each name in super,
|
||||
// multiple candidates happen only when we merge super and multiple
|
||||
// interfaces. Consider using `Map<Name, ExecutableElement>` here.
|
||||
for (var mixin in type.mixins) {
|
||||
var mixinElement = mixin.element;
|
||||
var interfaceObj = getInterface(mixin);
|
||||
_addCandidates(
|
||||
namedCandidates,
|
||||
interfaceObj,
|
||||
isNonNullableByDefault: isNonNullableByDefault,
|
||||
);
|
||||
// `class X extends S with M1, M2 {}` is semantically a sequence of:
|
||||
// class S&M1 extends S implements M1 {
|
||||
// // declared M1 members
|
||||
// }
|
||||
// class S&M2 extends S&M1 implements M2 {
|
||||
// // declared M2 members
|
||||
// }
|
||||
// class X extends S&M2 {
|
||||
// // declared X members
|
||||
// }
|
||||
// So, each mixin always replaces members in the interface.
|
||||
// And there are individual override conflicts for each mixin.
|
||||
var candidatesFromSuperAndMixin = <Name, List<ExecutableElement>>{};
|
||||
var mixinConflicts = <Conflict>[];
|
||||
for (var name in interfaceObj.map.keys) {
|
||||
var candidate = interfaceObj.map[name];
|
||||
|
||||
var currentList = namedCandidates[name];
|
||||
if (currentList == null) {
|
||||
namedCandidates[name] = [candidate];
|
||||
continue;
|
||||
}
|
||||
|
||||
var current = currentList.single;
|
||||
if (candidate.enclosingElement == mixinElement) {
|
||||
namedCandidates[name] = [candidate];
|
||||
if (current.kind != candidate.kind) {
|
||||
var currentIsGetter = current.kind == ElementKind.GETTER;
|
||||
mixinConflicts.add(
|
||||
Conflict(
|
||||
name,
|
||||
[current, candidate],
|
||||
currentIsGetter ? current : candidate,
|
||||
currentIsGetter ? candidate : current,
|
||||
),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
candidatesFromSuperAndMixin[name] = [current, candidate];
|
||||
}
|
||||
}
|
||||
|
||||
// Merge members from the superclass and the mixin interface.
|
||||
{
|
||||
var map = <Name, ExecutableElement>{};
|
||||
_findMostSpecificFromNamedCandidates(
|
||||
classElement,
|
||||
map,
|
||||
candidatesFromSuperAndMixin,
|
||||
);
|
||||
for (var entry in map.entries) {
|
||||
namedCandidates[entry.key] = [entry.value];
|
||||
}
|
||||
}
|
||||
|
||||
mixinsConflicts.add(mixinConflicts);
|
||||
|
||||
implemented = <Name, ExecutableElement>{}..addAll(implemented);
|
||||
implemented.addEntries(
|
||||
|
@ -185,6 +233,15 @@ class InheritanceManager3 {
|
|||
superImplemented.add(implemented);
|
||||
}
|
||||
}
|
||||
|
||||
for (var interface in type.interfaces) {
|
||||
var interfaceObj = getInterface(interface);
|
||||
_addCandidates(
|
||||
namedCandidates,
|
||||
interfaceObj,
|
||||
isNonNullableByDefault: isNonNullableByDefault,
|
||||
);
|
||||
}
|
||||
} finally {
|
||||
_processingClasses.remove(classElement);
|
||||
}
|
||||
|
@ -224,6 +281,15 @@ class InheritanceManager3 {
|
|||
}
|
||||
}
|
||||
|
||||
/// TODO(scheglov) Instead of merging conflicts we could report them on
|
||||
/// the corresponding mixins applied in the class.
|
||||
for (var mixinConflicts in mixinsConflicts) {
|
||||
if (mixinConflicts.isNotEmpty) {
|
||||
conflicts ??= [];
|
||||
conflicts.addAll(mixinConflicts);
|
||||
}
|
||||
}
|
||||
|
||||
var interface = Interface._(
|
||||
map,
|
||||
declared,
|
||||
|
@ -407,13 +473,8 @@ class InheritanceManager3 {
|
|||
conflicts.add(conflict);
|
||||
}
|
||||
|
||||
// Candidates are recorded in forward order, so
|
||||
// `class X extends S with M1, M2 implements I1, I2 {}` will record
|
||||
// candidates from [I1, I2, S, M1, M2]. But during method lookup
|
||||
// candidates should be considered in backward order, i.e. from `M2`,
|
||||
// then from `M1`, then from `S`.
|
||||
var validOverrides = <ExecutableElement>[];
|
||||
for (var i = candidates.length - 1; i >= 0; i--) {
|
||||
for (var i = 0; i < candidates.length; i++) {
|
||||
var validOverride = candidates[i];
|
||||
var overrideHelper = CorrectOverrideHelper(
|
||||
library: targetClass.library,
|
||||
|
|
|
@ -1079,6 +1079,31 @@ B.foo: void Function({required int a})
|
|||
''');
|
||||
}
|
||||
|
||||
test_getMember_mixin_notMerge_replace() async {
|
||||
await resolveTestCode('''
|
||||
class A<T> {
|
||||
T foo() => throw 0;
|
||||
}
|
||||
|
||||
mixin M<T> {
|
||||
T foo() => throw 1;
|
||||
}
|
||||
|
||||
class X extends A<dynamic> with M<Object?> {}
|
||||
class Y extends A<Object?> with M<dynamic> {}
|
||||
''');
|
||||
_assertGetMember2(
|
||||
className: 'X',
|
||||
name: 'foo',
|
||||
expected: 'M.foo: Object? Function()',
|
||||
);
|
||||
_assertGetMember2(
|
||||
className: 'Y',
|
||||
name: 'foo',
|
||||
expected: 'M.foo: dynamic Function()',
|
||||
);
|
||||
}
|
||||
|
||||
test_getMember_optIn_inheritsOptIn() async {
|
||||
newFile('/test/lib/a.dart', content: r'''
|
||||
class A {
|
||||
|
@ -1303,6 +1328,26 @@ class _InheritanceManager3Base extends DriverResolutionTest {
|
|||
_assertExecutable(member, expected);
|
||||
}
|
||||
|
||||
void _assertGetMember2({
|
||||
@required String className,
|
||||
@required String name,
|
||||
String expected,
|
||||
}) {
|
||||
_assertGetMember(
|
||||
className: className,
|
||||
name: name,
|
||||
expected: expected,
|
||||
concrete: false,
|
||||
);
|
||||
|
||||
_assertGetMember(
|
||||
className: className,
|
||||
name: name,
|
||||
expected: expected,
|
||||
concrete: true,
|
||||
);
|
||||
}
|
||||
|
||||
void _assertInheritedConcreteMap(String className, String expected) {
|
||||
var type = _classInterfaceType(className);
|
||||
var map = manager.getInheritedConcreteMap(type);
|
||||
|
|
|
@ -456,16 +456,6 @@ class B implements A, A, A, A {}
|
|||
]);
|
||||
}
|
||||
|
||||
test_error_memberWithClassName_getter() async {
|
||||
await assertErrorsInCode(r'''
|
||||
class C {
|
||||
int get C => null;
|
||||
}
|
||||
''', [
|
||||
error(ParserErrorCode.MEMBER_WITH_CLASS_NAME, 20, 1),
|
||||
]);
|
||||
}
|
||||
|
||||
test_error_memberWithClassName_field() async {
|
||||
await assertErrorsInCode(r'''
|
||||
class C {
|
||||
|
@ -476,6 +466,16 @@ class C {
|
|||
]);
|
||||
}
|
||||
|
||||
test_error_memberWithClassName_getter() async {
|
||||
await assertErrorsInCode(r'''
|
||||
class C {
|
||||
int get C => null;
|
||||
}
|
||||
''', [
|
||||
error(ParserErrorCode.MEMBER_WITH_CLASS_NAME, 20, 1),
|
||||
]);
|
||||
}
|
||||
|
||||
test_error_memberWithClassName_getter_static() async {
|
||||
await assertErrorsInCode(r'''
|
||||
class C {
|
||||
|
@ -587,6 +587,46 @@ abstract class C implements A, B {}
|
|||
]);
|
||||
}
|
||||
|
||||
test_inconsistentInheritanceGetterAndMethod_mixinApp() async {
|
||||
await assertErrorsInCode('''
|
||||
class S {
|
||||
bool get m => false;
|
||||
}
|
||||
|
||||
class M {
|
||||
int m() => 1;
|
||||
}
|
||||
|
||||
class C = S with M;
|
||||
''', [
|
||||
error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE_GETTER_AND_METHOD, 71,
|
||||
1),
|
||||
]);
|
||||
}
|
||||
|
||||
test_inconsistentInheritanceGetterAndMethod_mixinApp2() async {
|
||||
await assertErrorsInCode('''
|
||||
class S {
|
||||
bool get m => false;
|
||||
}
|
||||
|
||||
class M1 {
|
||||
int m() => 1;
|
||||
}
|
||||
|
||||
class M2 {
|
||||
bool get m => false;
|
||||
}
|
||||
|
||||
class C = S with M1, M2;
|
||||
''', [
|
||||
error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE_GETTER_AND_METHOD,
|
||||
109, 1),
|
||||
error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE_GETTER_AND_METHOD,
|
||||
109, 1),
|
||||
]);
|
||||
}
|
||||
|
||||
test_issue32815() async {
|
||||
await assertErrorsInCode(r'''
|
||||
class A<T> extends B<T> {}
|
||||
|
|
|
@ -2747,20 +2747,13 @@ class M2 {
|
|||
int x;
|
||||
}
|
||||
|
||||
class /*error:INCONSISTENT_INHERITANCE*/T1 extends Base
|
||||
with /*error:INVALID_OVERRIDE*/M1 {}
|
||||
class /*error:INCONSISTENT_INHERITANCE*/T2 extends Base
|
||||
with /*error:INVALID_OVERRIDE*/M1, M2 {}
|
||||
class /*error:INCONSISTENT_INHERITANCE*/T3 extends Base
|
||||
with M2, /*error:INVALID_OVERRIDE*/M1 {}
|
||||
class T1 extends Base with /*error:INVALID_OVERRIDE*/M1 {}
|
||||
class T2 extends Base with /*error:INVALID_OVERRIDE*/M1, M2 {}
|
||||
class T3 extends Base with M2, /*error:INVALID_OVERRIDE*/M1 {}
|
||||
|
||||
|
||||
class /*error:INCONSISTENT_INHERITANCE*/U1 = Base
|
||||
with /*error:INVALID_OVERRIDE*/M1;
|
||||
class /*error:INCONSISTENT_INHERITANCE*/U2 = Base
|
||||
with /*error:INVALID_OVERRIDE*/M1, M2;
|
||||
class /*error:INCONSISTENT_INHERITANCE*/U3 = Base
|
||||
with M2, /*error:INVALID_OVERRIDE*/M1;
|
||||
class U1 = Base with /*error:INVALID_OVERRIDE*/M1;
|
||||
class U2 = Base with /*error:INVALID_OVERRIDE*/M1, M2;
|
||||
class U3 = Base with M2, /*error:INVALID_OVERRIDE*/M1;
|
||||
''');
|
||||
}
|
||||
|
||||
|
@ -2782,13 +2775,9 @@ class M2 {
|
|||
int x;
|
||||
}
|
||||
|
||||
class /*error:INCONSISTENT_INHERITANCE*/T1 extends Base
|
||||
with M1,
|
||||
/*error:INVALID_OVERRIDE*/M2 {}
|
||||
class T1 extends Base with M1, /*error:INVALID_OVERRIDE*/M2 {}
|
||||
|
||||
class /*error:INCONSISTENT_INHERITANCE*/U1 = Base
|
||||
with M1,
|
||||
/*error:INVALID_OVERRIDE*/M2;
|
||||
class U1 = Base with M1, /*error:INVALID_OVERRIDE*/M2;
|
||||
''');
|
||||
}
|
||||
|
||||
|
@ -3410,11 +3399,9 @@ class M {
|
|||
m(B a) {}
|
||||
}
|
||||
|
||||
class /*error:INCONSISTENT_INHERITANCE*/T1 extends Base
|
||||
with /*error:INVALID_OVERRIDE*/M {}
|
||||
class T1 extends Base with /*error:INVALID_OVERRIDE*/M {}
|
||||
|
||||
class /*error:INCONSISTENT_INHERITANCE*/U1 = Base
|
||||
with /*error:INVALID_OVERRIDE*/M;
|
||||
class U1 = Base with /*error:INVALID_OVERRIDE*/M;
|
||||
''');
|
||||
}
|
||||
|
||||
|
@ -3434,11 +3421,9 @@ class M {
|
|||
m(B a) {}
|
||||
}
|
||||
|
||||
class /*error:INCONSISTENT_INHERITANCE*/T1 extends Base
|
||||
with /*error:INVALID_OVERRIDE*/M {}
|
||||
class T1 extends Base with /*error:INVALID_OVERRIDE*/M {}
|
||||
|
||||
class /*error:INCONSISTENT_INHERITANCE*/U1 = Base
|
||||
with /*error:INVALID_OVERRIDE*/M;
|
||||
class U1 = Base with /*error:INVALID_OVERRIDE*/M;
|
||||
''');
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
ERROR|COMPILE_TIME_ERROR|INCONSISTENT_INHERITANCE|lib/_internal/js_runtime/lib/interceptors.dart|1631|7|5|Superinterfaces don't have a valid override for '&': int.& (int Function(int)), JSNumber.& (num Function(num)).
|
||||
ERROR|COMPILE_TIME_ERROR|INCONSISTENT_INHERITANCE|lib/_internal/js_runtime/lib/interceptors.dart|1631|7|5|Superinterfaces don't have a valid override for '<<': int.<< (int Function(int)), JSNumber.<< (num Function(num)).
|
||||
ERROR|COMPILE_TIME_ERROR|INCONSISTENT_INHERITANCE|lib/_internal/js_runtime/lib/interceptors.dart|1631|7|5|Superinterfaces don't have a valid override for '>>': int.>> (int Function(int)), JSNumber.>> (num Function(num)).
|
||||
ERROR|COMPILE_TIME_ERROR|INCONSISTENT_INHERITANCE|lib/_internal/js_runtime/lib/interceptors.dart|1631|7|5|Superinterfaces don't have a valid override for '\|': int.\| (int Function(int)), JSNumber.\| (num Function(num)).
|
||||
ERROR|COMPILE_TIME_ERROR|INCONSISTENT_INHERITANCE|lib/_internal/js_runtime/lib/interceptors.dart|1631|7|5|Superinterfaces don't have a valid override for '^': int.^ (int Function(int)), JSNumber.^ (num Function(num)).
|
||||
ERROR|COMPILE_TIME_ERROR|INCONSISTENT_INHERITANCE|lib/_internal/js_runtime/lib/interceptors.dart|1631|7|5|Superinterfaces don't have a valid override for '&': JSNumber.& (num Function(num)), int.& (int Function(int)).
|
||||
ERROR|COMPILE_TIME_ERROR|INCONSISTENT_INHERITANCE|lib/_internal/js_runtime/lib/interceptors.dart|1631|7|5|Superinterfaces don't have a valid override for '<<': JSNumber.<< (num Function(num)), int.<< (int Function(int)).
|
||||
ERROR|COMPILE_TIME_ERROR|INCONSISTENT_INHERITANCE|lib/_internal/js_runtime/lib/interceptors.dart|1631|7|5|Superinterfaces don't have a valid override for '>>': JSNumber.>> (num Function(num)), int.>> (int Function(int)).
|
||||
ERROR|COMPILE_TIME_ERROR|INCONSISTENT_INHERITANCE|lib/_internal/js_runtime/lib/interceptors.dart|1631|7|5|Superinterfaces don't have a valid override for '\|': JSNumber.\| (num Function(num)), int.\| (int Function(int)).
|
||||
ERROR|COMPILE_TIME_ERROR|INCONSISTENT_INHERITANCE|lib/_internal/js_runtime/lib/interceptors.dart|1631|7|5|Superinterfaces don't have a valid override for '^': JSNumber.^ (num Function(num)), int.^ (int Function(int)).
|
||||
ERROR|STATIC_TYPE_WARNING|UNDEFINED_OPERATOR|lib/_internal/js_runtime/lib/interceptors.dart|1648|28|1|The operator '&' isn't defined for the type 'JSInt'.
|
||||
ERROR|STATIC_TYPE_WARNING|UNDEFINED_OPERATOR|lib/_internal/js_runtime/lib/interceptors.dart|1650|27|1|The operator '&' isn't defined for the type 'JSInt'.
|
||||
ERROR|STATIC_TYPE_WARNING|UNDEFINED_OPERATOR|lib/_internal/js_runtime/lib/interceptors.dart|1653|17|1|The operator '&' isn't defined for the type 'JSInt'.
|
||||
|
|
|
@ -13,7 +13,6 @@ class A {
|
|||
|
||||
class C extends Object with A {
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [cfe] Applying the mixin 'A' to 'Object' introduces an erroneous override of 'noSuchMethod'.
|
||||
// ^
|
||||
// [cfe] Class 'Object with A' inherits multiple members named 'noSuchMethod' with incompatible signatures.
|
||||
|
|
|
@ -22,7 +22,6 @@ class CTT<T> {
|
|||
// Wrong return type.
|
||||
abstract class C1 = CII with CIS;
|
||||
// ^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [cfe] Class 'C1' inherits multiple members named 'id' with incompatible signatures.
|
||||
// ^
|
||||
// [cfe] The mixin application class 'C1' introduces an erroneous override of 'id'.
|
||||
|
@ -30,7 +29,6 @@ abstract class C1 = CII with CIS;
|
|||
// [analyzer] COMPILE_TIME_ERROR.INVALID_OVERRIDE
|
||||
abstract class C2 extends CII with CIS {}
|
||||
// ^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [cfe] Applying the mixin 'CIS' to 'CII' introduces an erroneous override of 'id'.
|
||||
// ^
|
||||
// [cfe] Class 'CII with CIS' inherits multiple members named 'id' with incompatible signatures.
|
||||
|
@ -41,7 +39,6 @@ abstract class C2 extends CII with CIS {}
|
|||
// Wrong argument type.
|
||||
abstract class C3 = CII with CSI;
|
||||
// ^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [cfe] Class 'C3' inherits multiple members named 'id' with incompatible signatures.
|
||||
// ^
|
||||
// [cfe] The mixin application class 'C3' introduces an erroneous override of 'id'.
|
||||
|
@ -49,7 +46,6 @@ abstract class C3 = CII with CSI;
|
|||
// [analyzer] COMPILE_TIME_ERROR.INVALID_OVERRIDE
|
||||
abstract class C4 extends CII with CSI {}
|
||||
// ^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [cfe] Applying the mixin 'CSI' to 'CII' introduces an erroneous override of 'id'.
|
||||
// ^
|
||||
// [cfe] Class 'CII with CSI' inherits multiple members named 'id' with incompatible signatures.
|
||||
|
@ -61,7 +57,6 @@ abstract class C5 = CII with CTT<int>;
|
|||
abstract class C6 extends CII with CTT<int> {}
|
||||
abstract class C7 = CII with CTT<String>;
|
||||
// ^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [cfe] Class 'C7' inherits multiple members named 'id' with incompatible signatures.
|
||||
// ^
|
||||
// [cfe] The mixin application class 'C7' introduces an erroneous override of 'id'.
|
||||
|
@ -69,7 +64,6 @@ abstract class C7 = CII with CTT<String>;
|
|||
// [analyzer] COMPILE_TIME_ERROR.INVALID_OVERRIDE
|
||||
abstract class C8 extends CII with CTT<String> {}
|
||||
// ^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [cfe] Applying the mixin 'CTT' to 'CII' introduces an erroneous override of 'id'.
|
||||
// ^
|
||||
// [cfe] Class 'CII with CTT<String>' inherits multiple members named 'id' with incompatible signatures.
|
||||
|
@ -99,7 +93,6 @@ abstract class N2 extends NIIx with NIIxy {}
|
|||
// It's NOT OK to rename named parameters.
|
||||
abstract class N3 = NIIx with NIIy;
|
||||
// ^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [cfe] Class 'N3' inherits multiple members named 'id' with incompatible signatures.
|
||||
// ^
|
||||
// [cfe] The mixin application class 'N3' introduces an erroneous override of 'id'.
|
||||
|
@ -107,7 +100,6 @@ abstract class N3 = NIIx with NIIy;
|
|||
// [analyzer] COMPILE_TIME_ERROR.INVALID_OVERRIDE
|
||||
abstract class N4 extends NIIx with NIIy {}
|
||||
// ^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [cfe] Applying the mixin 'NIIy' to 'NIIx' introduces an erroneous override of 'id'.
|
||||
// ^
|
||||
// [cfe] Class 'NIIx with NIIy' inherits multiple members named 'id' with incompatible signatures.
|
||||
|
@ -118,7 +110,6 @@ abstract class N4 extends NIIx with NIIy {}
|
|||
// It's NOT OK to drop named parameters.
|
||||
abstract class N5 = NIIx with NII;
|
||||
// ^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [cfe] Class 'N5' inherits multiple members named 'id' with incompatible signatures.
|
||||
// ^
|
||||
// [cfe] The mixin application class 'N5' introduces an erroneous override of 'id'.
|
||||
|
@ -126,7 +117,6 @@ abstract class N5 = NIIx with NII;
|
|||
// [analyzer] COMPILE_TIME_ERROR.INVALID_OVERRIDE
|
||||
abstract class N6 extends NIIx with NII {}
|
||||
// ^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [cfe] Applying the mixin 'NII' to 'NIIx' introduces an erroneous override of 'id'.
|
||||
// ^
|
||||
// [cfe] Class 'NIIx with NII' inherits multiple members named 'id' with incompatible signatures.
|
||||
|
@ -150,7 +140,6 @@ abstract class N7 = NIIx with NBABxy<int, int>;
|
|||
abstract class N8 extends NIIx with NBABxy<int, int> {}
|
||||
abstract class N9 = NIIx with NBABxy<String, int>;
|
||||
// ^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [cfe] Class 'N9' inherits multiple members named 'id' with incompatible signatures.
|
||||
// ^
|
||||
// [cfe] The mixin application class 'N9' introduces an erroneous override of 'id'.
|
||||
|
@ -158,7 +147,6 @@ abstract class N9 = NIIx with NBABxy<String, int>;
|
|||
// [analyzer] COMPILE_TIME_ERROR.INVALID_OVERRIDE
|
||||
abstract class N10 extends NIIx with NBABxy<String, int> {}
|
||||
// ^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [cfe] Applying the mixin 'NBABxy' to 'NIIx' introduces an erroneous override of 'id'.
|
||||
// ^
|
||||
// [cfe] Class 'NIIx with NBABxy<String, int>' inherits multiple members named 'id' with incompatible signatures.
|
||||
|
@ -166,7 +154,6 @@ abstract class N10 extends NIIx with NBABxy<String, int> {}
|
|||
// [analyzer] COMPILE_TIME_ERROR.INVALID_OVERRIDE
|
||||
abstract class N11 = NIIx with NTTy<int>;
|
||||
// ^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [cfe] Class 'N11' inherits multiple members named 'id' with incompatible signatures.
|
||||
// ^
|
||||
// [cfe] The mixin application class 'N11' introduces an erroneous override of 'id'.
|
||||
|
@ -174,7 +161,6 @@ abstract class N11 = NIIx with NTTy<int>;
|
|||
// [analyzer] COMPILE_TIME_ERROR.INVALID_OVERRIDE
|
||||
abstract class N12 extends NIIx with NTTy<int> {}
|
||||
// ^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [cfe] Applying the mixin 'NTTy' to 'NIIx' introduces an erroneous override of 'id'.
|
||||
// ^
|
||||
// [cfe] Class 'NIIx with NTTy<int>' inherits multiple members named 'id' with incompatible signatures.
|
||||
|
@ -182,7 +168,6 @@ abstract class N12 extends NIIx with NTTy<int> {}
|
|||
// [analyzer] COMPILE_TIME_ERROR.INVALID_OVERRIDE
|
||||
abstract class N13 = NIIx with NTTx<int>;
|
||||
// ^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [cfe] Class 'N13' inherits multiple members named 'id' with incompatible signatures.
|
||||
// ^
|
||||
// [cfe] The mixin application class 'N13' introduces an erroneous override of 'id'.
|
||||
|
@ -190,7 +175,6 @@ abstract class N13 = NIIx with NTTx<int>;
|
|||
// [analyzer] COMPILE_TIME_ERROR.INVALID_OVERRIDE
|
||||
abstract class N14 extends NIIx with NTTx<int> {}
|
||||
// ^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [cfe] Applying the mixin 'NTTx' to 'NIIx' introduces an erroneous override of 'id'.
|
||||
// ^
|
||||
// [cfe] Class 'NIIx with NTTx<int>' inherits multiple members named 'id' with incompatible signatures.
|
||||
|
@ -249,7 +233,6 @@ abstract class O7 = OII with OBAB<int, int>;
|
|||
abstract class O8 extends OII with OBAB<int, int> {}
|
||||
abstract class O9 = OII with OBAB<String, int>;
|
||||
// ^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [cfe] Class 'O9' inherits multiple members named 'id' with incompatible signatures.
|
||||
// ^
|
||||
// [cfe] The mixin application class 'O9' introduces an erroneous override of 'id'.
|
||||
|
@ -257,7 +240,6 @@ abstract class O9 = OII with OBAB<String, int>;
|
|||
// [analyzer] COMPILE_TIME_ERROR.INVALID_OVERRIDE
|
||||
abstract class O10 extends OII with OBAB<String, int> {}
|
||||
// ^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [cfe] Applying the mixin 'OBAB' to 'OII' introduces an erroneous override of 'id'.
|
||||
// ^
|
||||
// [cfe] Class 'OII with OBAB<String, int>' inherits multiple members named 'id' with incompatible signatures.
|
||||
|
@ -299,7 +281,6 @@ class MTTnumR {
|
|||
class G1 = GTTnum with MTTnum;
|
||||
class G2 = GTTnum with MTTint;
|
||||
// ^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [cfe] Class 'G2' inherits multiple members named 'id' with incompatible signatures.
|
||||
// ^
|
||||
// [cfe] The mixin application class 'G2' introduces an erroneous override of 'id'.
|
||||
|
@ -307,7 +288,6 @@ class G2 = GTTnum with MTTint;
|
|||
// [analyzer] COMPILE_TIME_ERROR.INVALID_OVERRIDE
|
||||
class G3 = GTTnum with MTT;
|
||||
// ^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [cfe] Class 'G3' inherits multiple members named 'id' with incompatible signatures.
|
||||
// ^
|
||||
// [cfe] The mixin application class 'G3' introduces an erroneous override of 'id'.
|
||||
|
@ -315,7 +295,6 @@ class G3 = GTTnum with MTT;
|
|||
// [analyzer] COMPILE_TIME_ERROR.INVALID_OVERRIDE
|
||||
class G4 = GTTnum with MTTnumR;
|
||||
// ^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [cfe] Class 'G4' inherits multiple members named 'id' with incompatible signatures.
|
||||
// ^
|
||||
// [cfe] The mixin application class 'G4' introduces an erroneous override of 'id'.
|
||||
|
@ -323,7 +302,7 @@ class G4 = GTTnum with MTTnumR;
|
|||
// [analyzer] COMPILE_TIME_ERROR.INVALID_OVERRIDE
|
||||
class G5 = GTTnum with CII;
|
||||
// ^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INCONSISTENT_INHERITANCE
|
||||
// [analyzer] STATIC_WARNING.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER
|
||||
// [cfe] The mixin application class 'G5' introduces an erroneous override of 'id'.
|
||||
// ^
|
||||
// [cfe] The non-abstract class 'G5' is missing implementations for these members:
|
||||
|
|
|
@ -21,7 +21,6 @@ class M2 {
|
|||
|
||||
class Derived extends BaseWithM1 with M2 {}
|
||||
// ^^^^^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INVALID_OVERRIDE
|
||||
// [cfe] Applying the mixin 'M2' to 'BaseWithM1' introduces an erroneous override of 'foo'.
|
||||
// ^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INVALID_OVERRIDE
|
||||
|
|
Loading…
Reference in a new issue