mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 23:29:47 +00:00
In legacy libraries apply LEGACY_ERASURE to concrete members.
This fixes with unforked SDK: * language_2/abstract/equal_test * language_2/abstract/object_method_test Change-Id: I8d183f5a15eef29c590fe56f40e813d56ba6ad54 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135359 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
parent
ad5ee10e69
commit
08778f9045
|
@ -231,6 +231,7 @@ class _ClassVerifier {
|
|||
// diagnostic should be reported on the name of the mixin defining the
|
||||
// method. In other cases, it should be reported on the name of the
|
||||
// overriding method. The classNameNode is always wrong.
|
||||
concreteElement = library.toLegacyElementIfOptOut(concreteElement);
|
||||
CorrectOverrideHelper(
|
||||
typeSystem: typeSystem,
|
||||
thisMember: concreteElement,
|
||||
|
|
|
@ -505,6 +505,23 @@ class InvalidOverrideWithNnbdTest extends DriverResolutionTest {
|
|||
@override
|
||||
bool get typeToStringWithNullability => true;
|
||||
|
||||
test_method_parameter_interfaceOptOut_concreteOptIn() async {
|
||||
newFile('/test/lib/a.dart', content: r'''
|
||||
class A {
|
||||
void foo(Object a) {}
|
||||
}
|
||||
''');
|
||||
|
||||
await assertNoErrorsInCode('''
|
||||
// @dart=2.6
|
||||
import 'a.dart';
|
||||
|
||||
class B extends A {
|
||||
void foo(dynamic a);
|
||||
}
|
||||
''');
|
||||
}
|
||||
|
||||
test_method_viaLegacy_returnType_notSubtype() async {
|
||||
newFile('/test/lib/a.dart', content: r'''
|
||||
class Nullable {
|
||||
|
|
Loading…
Reference in a new issue