Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 029c8f1

Browse files
Dmitry Stefantsovcommit-bot@chromium.org
authored andcommitted
[cfe] Use Supertype instead of InterfaceType in ClassHierarchyBuilder
Change-Id: I1a11ce32237480c0eddf50a7a86cd56b89116e77 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138801 Commit-Queue: Dmitry Stefantsov <[email protected]> Reviewed-by: Johnni Winther <[email protected]>
1 parent e8c58a7 commit 029c8f1

File tree

4 files changed

+141
-139
lines changed

4 files changed

+141
-139
lines changed

pkg/front_end/lib/src/fasta/builder/named_type_builder.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import '../fasta_codes.dart'
1616
templateMissingExplicitTypeArguments,
1717
messageNotATypeContext,
1818
LocatedMessage,
19+
templateExtendingRestricted,
1920
templateNotAType,
2021
templateTypeArgumentMismatch,
2122
templateTypeArgumentsOnTypeVariable,
@@ -226,6 +227,13 @@ class NamedTypeBuilder extends TypeBuilder {
226227
LibraryBuilder library, int charOffset, Uri fileUri) {
227228
TypeDeclarationBuilder declaration = this.declaration;
228229
if (declaration is ClassBuilder) {
230+
if (declaration.isNullClass && !library.mayImplementRestrictedTypes) {
231+
library.addProblem(
232+
templateExtendingRestricted.withArguments(declaration.name),
233+
charOffset,
234+
noLength,
235+
fileUri);
236+
}
229237
return declaration.buildSupertype(library, arguments);
230238
} else if (declaration is TypeAliasBuilder) {
231239
TypeDeclarationBuilder declarationBuilder =

0 commit comments

Comments
 (0)