Skip to content

Commit d7cd11f

Browse files
author
John Messerly
committed
allow dart:* libs to implement otherwise disallowed types (e.g. int)
all current and experimental Dart implementations (dart2js, vm, fletch, ddc) get an error in their SDK from this. The CL fixes it by allowing dart:* libraries to implement the disallowed types, like int/double/String/bool. [email protected] Review URL: https://codereview.chromium.org//1346923007 .
1 parent 19d7f93 commit d7cd11f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/analyzer/lib/src/generated/error_verifier.dart

+5
Original file line numberDiff line numberDiff line change
@@ -3199,6 +3199,11 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
31993199
if (typeName.isSynthetic) {
32003200
return false;
32013201
}
3202+
// The SDK implementation may implement disallowed types. For example,
3203+
// JSNumber in dart2js and _Smi in Dart VM both implement int.
3204+
if (_currentLibrary.source.isInSystemLibrary) {
3205+
return false;
3206+
}
32023207
DartType superType = typeName.type;
32033208
for (InterfaceType disallowedType
32043209
in _DISALLOWED_TYPES_TO_EXTEND_OR_IMPLEMENT) {

0 commit comments

Comments
 (0)