[cfe] Report error on nullable supertypes through type aliases

Closes #43261
Closes #45423

Change-Id: Ia22975f9cd8fd3835b0feda82c6d5310098b605c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193501
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
diff --git a/pkg/front_end/lib/src/fasta/builder/named_type_builder.dart b/pkg/front_end/lib/src/fasta/builder/named_type_builder.dart
index 1833d4f..31a334d 100644
--- a/pkg/front_end/lib/src/fasta/builder/named_type_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/named_type_builder.dart
@@ -21,6 +21,8 @@
         templateExtendingRestricted,
         templateNotAType,
         templateSupertypeIsIllegal,
+        templateSupertypeIsIllegalAliased,
+        templateSupertypeIsNullableAliased,
         templateSupertypeIsTypeVariable,
         templateTypeArgumentMismatch,
         templateTypeArgumentsOnTypeVariable,
@@ -177,7 +179,7 @@
   String get debugName => "NamedTypeBuilder";
 
   StringBuffer printOn(StringBuffer buffer) {
-    buffer.write(name);
+    buffer.write(flattenName(name, charOffset, fileUri));
     if (arguments?.isEmpty ?? true) return buffer;
     buffer.write("<");
     bool first = true;
@@ -201,29 +203,39 @@
         context: context);
   }
 
-  Supertype handleInvalidSupertype(LibraryBuilder library, int charOffset,
-      Uri fileUri, TypeAliasBuilder aliasBuilder) {
+  Supertype handleInvalidSupertype(
+      LibraryBuilder library, int charOffset, Uri fileUri) {
     Template<Message Function(String name)> template =
         declaration.isTypeVariable
             ? templateSupertypeIsTypeVariable
             : templateSupertypeIsIllegal;
-    if (aliasBuilder != null) {
-      library.addProblem(
-          template.withArguments(flattenName(name, charOffset, fileUri)),
-          charOffset,
-          noLength,
-          fileUri,
-          context: [
-            messageTypedefCause.withLocation(
-                aliasBuilder.fileUri, aliasBuilder.charOffset, noLength),
-          ]);
-    } else {
-      library.addProblem(
-          template.withArguments(flattenName(name, charOffset, fileUri)),
-          charOffset,
-          noLength,
-          fileUri);
-    }
+    library.addProblem(template.withArguments(fullNameForErrors), charOffset,
+        noLength, fileUri);
+    return null;
+  }
+
+  Supertype handleInvalidAliasedSupertype(
+      LibraryBuilder library,
+      int charOffset,
+      Uri fileUri,
+      TypeAliasBuilder aliasBuilder,
+      DartType type) {
+    Template<Message Function(String name, DartType type, bool)> template =
+        declaration.isTypeVariable
+            ? templateSupertypeIsTypeVariable
+            : (type != null && type.nullability == Nullability.nullable
+                ? templateSupertypeIsNullableAliased
+                : templateSupertypeIsIllegalAliased);
+    library.addProblem(
+        template.withArguments(
+            fullNameForErrors, type, library.isNonNullableByDefault),
+        charOffset,
+        noLength,
+        fileUri,
+        context: [
+          messageTypedefCause.withLocation(
+              aliasBuilder.fileUri, aliasBuilder.charOffset, noLength),
+        ]);
     return null;
   }
 
@@ -266,7 +278,6 @@
   Supertype buildSupertype(
       LibraryBuilder library, int charOffset, Uri fileUri) {
     TypeDeclarationBuilder declaration = this.declaration;
-    TypeAliasBuilder aliasBuilder; // Non-null if a type alias is used.
     if (declaration is ClassBuilder) {
       if (declaration.isNullClass && !library.mayImplementRestrictedTypes) {
         library.addProblem(
@@ -277,10 +288,10 @@
       }
       return declaration.buildSupertype(library, arguments);
     } else if (declaration is TypeAliasBuilder) {
-      aliasBuilder = declaration;
+      TypeAliasBuilder aliasBuilder = declaration;
       DartType type =
           declaration.buildType(library, library.nonNullableBuilder, arguments);
-      if (type is InterfaceType) {
+      if (type is InterfaceType && type.nullability != Nullability.nullable) {
         return new Supertype(type.classNode, type.typeArguments);
       } else if (type is NullType) {
         // Even though Null is disallowed as a supertype, ClassHierarchyBuilder
@@ -324,9 +335,9 @@
             unaliasedDeclaration.name == "FutureOr");
         return new Supertype((unaliasedDeclaration as ClassBuilder).cls,
             <DartType>[type.typeArgument]);
-      } else {
-        // Do nothing: handleInvalidSuper below will handle the erroneous case.
       }
+      return handleInvalidAliasedSupertype(
+          library, charOffset, fileUri, aliasBuilder, type);
     } else if (declaration is InvalidTypeDeclarationBuilder) {
       library.addProblem(
           declaration.message.messageObject,
@@ -336,22 +347,23 @@
           severity: Severity.error);
       return null;
     }
-    return handleInvalidSupertype(library, charOffset, fileUri, aliasBuilder);
+    return handleInvalidSupertype(library, charOffset, fileUri);
   }
 
   Supertype buildMixedInType(
       LibraryBuilder library, int charOffset, Uri fileUri) {
     TypeDeclarationBuilder declaration = this.declaration;
-    TypeAliasBuilder aliasBuilder; // Non-null if a type alias is used.
     if (declaration is ClassBuilder) {
       return declaration.buildMixedInType(library, arguments);
     } else if (declaration is TypeAliasBuilder) {
-      aliasBuilder = declaration;
+      TypeAliasBuilder aliasBuilder = declaration;
       DartType type =
           declaration.buildType(library, library.nonNullableBuilder, arguments);
-      if (type is InterfaceType) {
+      if (type is InterfaceType && type.nullability != Nullability.nullable) {
         return new Supertype(type.classNode, type.typeArguments);
       }
+      return handleInvalidAliasedSupertype(
+          library, charOffset, fileUri, aliasBuilder, type);
     } else if (declaration is InvalidTypeDeclarationBuilder) {
       library.addProblem(
           declaration.message.messageObject,
@@ -361,7 +373,7 @@
           severity: Severity.error);
       return null;
     }
-    return handleInvalidSupertype(library, charOffset, fileUri, aliasBuilder);
+    return handleInvalidSupertype(library, charOffset, fileUri);
   }
 
   TypeBuilder subst(Map<TypeVariableBuilder, TypeBuilder> substitution) {
diff --git a/pkg/front_end/lib/src/fasta/fasta_codes_cfe_generated.dart b/pkg/front_end/lib/src/fasta/fasta_codes_cfe_generated.dart
index 21f427c..4e0e710 100644
--- a/pkg/front_end/lib/src/fasta/fasta_codes_cfe_generated.dart
+++ b/pkg/front_end/lib/src/fasta/fasta_codes_cfe_generated.dart
@@ -4631,6 +4631,78 @@
 // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
 const Template<
         Message Function(
+            String name, DartType _type, bool isNonNullableByDefault)>
+    templateSupertypeIsIllegalAliased = const Template<
+            Message Function(
+                String name, DartType _type, bool isNonNullableByDefault)>(
+        messageTemplate:
+            r"""The type '#name' which is an alias of '#type' can't be used as supertype.""",
+        withArguments: _withArgumentsSupertypeIsIllegalAliased);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<
+        Message Function(
+            String name, DartType _type, bool isNonNullableByDefault)>
+    codeSupertypeIsIllegalAliased = const Code<
+            Message Function(
+                String name, DartType _type, bool isNonNullableByDefault)>(
+        "SupertypeIsIllegalAliased",
+        analyzerCodes: <String>["EXTENDS_NON_CLASS"]);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+Message _withArgumentsSupertypeIsIllegalAliased(
+    String name, DartType _type, bool isNonNullableByDefault) {
+  if (name.isEmpty) throw 'No name provided';
+  name = demangleMixinApplicationName(name);
+  TypeLabeler labeler = new TypeLabeler(isNonNullableByDefault);
+  List<Object> typeParts = labeler.labelType(_type);
+  String type = typeParts.join();
+  return new Message(codeSupertypeIsIllegalAliased,
+      message:
+          """The type '${name}' which is an alias of '${type}' can't be used as supertype.""" +
+              labeler.originMessages,
+      arguments: {'name': name, 'type': _type});
+}
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Template<
+        Message Function(
+            String name, DartType _type, bool isNonNullableByDefault)>
+    templateSupertypeIsNullableAliased = const Template<
+            Message Function(
+                String name, DartType _type, bool isNonNullableByDefault)>(
+        messageTemplate:
+            r"""The type '#name' which is an alias of '#type' can't be used as supertype because it is nullable.""",
+        withArguments: _withArgumentsSupertypeIsNullableAliased);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<
+        Message Function(
+            String name, DartType _type, bool isNonNullableByDefault)>
+    codeSupertypeIsNullableAliased = const Code<
+            Message Function(
+                String name, DartType _type, bool isNonNullableByDefault)>(
+        "SupertypeIsNullableAliased",
+        analyzerCodes: <String>["EXTENDS_NON_CLASS"]);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+Message _withArgumentsSupertypeIsNullableAliased(
+    String name, DartType _type, bool isNonNullableByDefault) {
+  if (name.isEmpty) throw 'No name provided';
+  name = demangleMixinApplicationName(name);
+  TypeLabeler labeler = new TypeLabeler(isNonNullableByDefault);
+  List<Object> typeParts = labeler.labelType(_type);
+  String type = typeParts.join();
+  return new Message(codeSupertypeIsNullableAliased,
+      message:
+          """The type '${name}' which is an alias of '${type}' can't be used as supertype because it is nullable.""" +
+              labeler.originMessages,
+      arguments: {'name': name, 'type': _type});
+}
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Template<
+        Message Function(
             DartType _type, DartType _type2, bool isNonNullableByDefault)>
     templateSwitchExpressionNotAssignable = const Template<
             Message Function(
diff --git a/pkg/front_end/lib/src/fasta/kernel/type_labeler.dart b/pkg/front_end/lib/src/fasta/kernel/type_labeler.dart
index f7d816c..e097eca 100644
--- a/pkg/front_end/lib/src/fasta/kernel/type_labeler.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/type_labeler.dart
@@ -112,8 +112,8 @@
     result.add(nameForEntity(
         typedefNode,
         typedefNode.name,
-        typedefNode.enclosingLibrary.importUri,
-        typedefNode.enclosingLibrary.fileUri));
+        typedefNode?.enclosingLibrary?.importUri ?? unknownUri,
+        typedefNode?.enclosingLibrary?.fileUri ?? unknownUri));
     if (node.typeArguments.isNotEmpty) {
       result.add("<");
       bool first = true;
@@ -226,8 +226,10 @@
     result.add(nameForEntity(
         classNode,
         classNode.name,
-        classNode.enclosingLibrary.importUri,
-        classNode.enclosingLibrary.fileUri));
+        // TODO(johnniwinther): Ensure enclosing libraries on classes earlier
+        // in the compiler to ensure types in error messages have context.
+        classNode?.enclosingLibrary?.importUri ?? unknownUri,
+        classNode?.enclosingLibrary?.fileUri ?? unknownUri));
     if (node.typeArguments.isNotEmpty) {
       result.add("<");
       bool first = true;
@@ -252,8 +254,8 @@
     result.add(nameForEntity(
         node.extension,
         node.extension.name,
-        node.extension.enclosingLibrary.importUri,
-        node.extension.enclosingLibrary.fileUri));
+        node.extension?.enclosingLibrary?.importUri ?? unknownUri,
+        node.extension?.enclosingLibrary?.fileUri ?? unknownUri));
     if (node.typeArguments.isNotEmpty) {
       result.add("<");
       bool first = true;
diff --git a/pkg/front_end/messages.status b/pkg/front_end/messages.status
index d25dfc3..cebc0ac 100644
--- a/pkg/front_end/messages.status
+++ b/pkg/front_end/messages.status
@@ -745,6 +745,8 @@
 SupertypeIsFunction/analyzerCode: Fail
 SupertypeIsFunction/example: Fail
 SupertypeIsIllegal/example: Fail
+SupertypeIsIllegalAliased/example: Fail
+SupertypeIsNullableAliased/example: Fail
 SupertypeIsTypeVariable/example: Fail
 SwitchCaseFallThrough/example: Fail
 SwitchExpressionNotSubtype/analyzerCode: Fail
diff --git a/pkg/front_end/messages.yaml b/pkg/front_end/messages.yaml
index c5be3f5..9525c92 100644
--- a/pkg/front_end/messages.yaml
+++ b/pkg/front_end/messages.yaml
@@ -2952,6 +2952,14 @@
   template: "The type '#name' can't be used as supertype."
   analyzerCode: EXTENDS_NON_CLASS
 
+SupertypeIsIllegalAliased:
+  template: "The type '#name' which is an alias of '#type' can't be used as supertype."
+  analyzerCode: EXTENDS_NON_CLASS
+
+SupertypeIsNullableAliased:
+  template: "The type '#name' which is an alias of '#type' can't be used as supertype because it is nullable."
+  analyzerCode: EXTENDS_NON_CLASS
+
 SupertypeIsTypeVariable:
   template: "The type variable '#name' can't be used as supertype."
   analyzerCode: EXTENDS_NON_CLASS
diff --git a/pkg/front_end/test/spell_checking_list_tests.txt b/pkg/front_end/test/spell_checking_list_tests.txt
index 8050222..17ee5f0 100644
--- a/pkg/front_end/test/spell_checking_list_tests.txt
+++ b/pkg/front_end/test/spell_checking_list_tests.txt
@@ -180,6 +180,8 @@
 cursor
 cuts
 cx
+d1a
+d1b
 dacoharkes
 dadd
 daemon
@@ -523,6 +525,8 @@
 mx
 mxn
 mysdk
+n1a
+n1b
 naively
 naturally
 negatable
diff --git a/pkg/front_end/testcases/general/qualified.dart.weak.expect b/pkg/front_end/testcases/general/qualified.dart.weak.expect
index a51969d..b829051 100644
--- a/pkg/front_end/testcases/general/qualified.dart.weak.expect
+++ b/pkg/front_end/testcases/general/qualified.dart.weak.expect
@@ -17,7 +17,7 @@
 //   lib.Missing method() {}
 //   ^^^^^^^^^^^
 //
-// pkg/front_end/testcases/general/qualified.dart:18:7: Error: The type 'lib.VoidFunction' can't be used as supertype.
+// pkg/front_end/testcases/general/qualified.dart:18:7: Error: The type 'lib.VoidFunction' which is an alias of 'void Function()' can't be used as supertype.
 // class IllegalSupertype extends lib.VoidFunction {}
 //       ^
 // pkg/front_end/testcases/general/qualified_lib.dart:27:9: Context: The issue arises via this type alias.
diff --git a/pkg/front_end/testcases/general/qualified.dart.weak.outline.expect b/pkg/front_end/testcases/general/qualified.dart.weak.outline.expect
index fcf8ecc..2102d04 100644
--- a/pkg/front_end/testcases/general/qualified.dart.weak.outline.expect
+++ b/pkg/front_end/testcases/general/qualified.dart.weak.outline.expect
@@ -17,7 +17,7 @@
 //   lib.Missing method() {}
 //   ^^^^^^^^^^^
 //
-// pkg/front_end/testcases/general/qualified.dart:18:7: Error: The type 'lib.VoidFunction' can't be used as supertype.
+// pkg/front_end/testcases/general/qualified.dart:18:7: Error: The type 'lib.VoidFunction' which is an alias of 'void Function()' can't be used as supertype.
 // class IllegalSupertype extends lib.VoidFunction {}
 //       ^
 // pkg/front_end/testcases/general/qualified_lib.dart:27:9: Context: The issue arises via this type alias.
diff --git a/pkg/front_end/testcases/general/qualified.dart.weak.transformed.expect b/pkg/front_end/testcases/general/qualified.dart.weak.transformed.expect
index 25de173..003ca00 100644
--- a/pkg/front_end/testcases/general/qualified.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/general/qualified.dart.weak.transformed.expect
@@ -17,7 +17,7 @@
 //   lib.Missing method() {}
 //   ^^^^^^^^^^^
 //
-// pkg/front_end/testcases/general/qualified.dart:18:7: Error: The type 'lib.VoidFunction' can't be used as supertype.
+// pkg/front_end/testcases/general/qualified.dart:18:7: Error: The type 'lib.VoidFunction' which is an alias of 'void Function()' can't be used as supertype.
 // class IllegalSupertype extends lib.VoidFunction {}
 //       ^
 // pkg/front_end/testcases/general/qualified_lib.dart:27:9: Context: The issue arises via this type alias.
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart b/pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart
new file mode 100644
index 0000000..30966c9
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart
@@ -0,0 +1,57 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'nullable_supertypes.dart' as prefix;
+
+class A {}
+class B {}
+class C {}
+
+typedef AAlias = A?;
+typedef BAlias = B?;
+typedef CAlias = C?;
+typedef TAlias<T> = T?;
+
+class C1 extends AAlias {}
+
+class C2 implements AAlias {}
+
+class C3 = A with BAlias;
+
+class C4 = A with B implements CAlias;
+
+class C5 extends A with BAlias {}
+
+mixin M1 on AAlias {}
+
+mixin M2 on A, BAlias {}
+
+mixin M3 on A implements BAlias {}
+
+class D1 extends TAlias<A> {}
+
+class D1a extends prefix.TAlias<A> {}
+
+class D1b extends TAlias<prefix.A> {}
+
+class D2 implements TAlias<A> {}
+
+class D3 = A with TAlias<B>;
+
+class D4 = A with B implements TAlias<C>;
+
+class D5 extends A with TAlias<B> {}
+
+mixin N1 on TAlias<A> {}
+
+mixin N1a on prefix.TAlias<A> {}
+
+mixin N1b on TAlias<prefix.A> {}
+
+mixin N2 on A, TAlias<B> {}
+
+mixin N3 on A implements TAlias<B> {}
+
+main() {
+}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart.strong.expect b/pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart.strong.expect
new file mode 100644
index 0000000..1a2fe24
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart.strong.expect
@@ -0,0 +1,383 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:32:18: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D1 extends TAlias<A> {}
+//                  ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:34:19: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D1a extends prefix.TAlias<A> {}
+//                   ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:36:19: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D1b extends TAlias<prefix.A> {}
+//                   ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:38:21: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D2 implements TAlias<A> {}
+//                     ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:40:19: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D3 = A with TAlias<B>;
+//                   ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:40:7: Error: The type 'TAlias' can't be mixed in.
+// class D3 = A with TAlias<B>;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:42:32: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D4 = A with B implements TAlias<C>;
+//                                ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:44:25: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D5 extends A with TAlias<B> {}
+//                         ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:44:7: Error: The type 'TAlias' can't be mixed in.
+// class D5 extends A with TAlias<B> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:46:13: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N1 on TAlias<A> {}
+//             ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:48:14: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N1a on prefix.TAlias<A> {}
+//              ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:50:14: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N1b on TAlias<prefix.A> {}
+//              ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:52:16: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N2 on A, TAlias<B> {}
+//                ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:54:26: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N3 on A implements TAlias<B> {}
+//                          ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:16:7: Error: The type 'AAlias' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C1 extends AAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:11:9: Context: The issue arises via this type alias.
+// typedef AAlias = A?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:18:7: Error: The type 'AAlias' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C2 implements AAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:11:9: Context: The issue arises via this type alias.
+// typedef AAlias = A?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:20:7: Error: The type 'BAlias' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C3 = A with BAlias;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:12:9: Context: The issue arises via this type alias.
+// typedef BAlias = B?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:22:7: Error: The type 'CAlias' which is an alias of 'C?' can't be used as supertype because it is nullable.
+//  - 'C' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C4 = A with B implements CAlias;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:13:9: Context: The issue arises via this type alias.
+// typedef CAlias = C?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:24:7: Error: The type 'BAlias' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C5 extends A with BAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:12:9: Context: The issue arises via this type alias.
+// typedef BAlias = B?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:26:7: Error: The type 'AAlias' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin M1 on AAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:11:9: Context: The issue arises via this type alias.
+// typedef AAlias = A?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:28:7: Error: The type 'BAlias' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin M2 on A, BAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:12:9: Context: The issue arises via this type alias.
+// typedef BAlias = B?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:30:7: Error: The type 'BAlias' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin M3 on A implements BAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:12:9: Context: The issue arises via this type alias.
+// typedef BAlias = B?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:32:7: Error: The type 'TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D1 extends TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:34:7: Error: The type 'prefix.TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D1a extends prefix.TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:36:7: Error: The type 'TAlias<prefix.A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D1b extends TAlias<prefix.A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:38:7: Error: The type 'TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D2 implements TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:40:7: Error: The type 'TAlias<B>' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D3 = A with TAlias<B>;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:42:7: Error: The type 'TAlias<C>' which is an alias of 'C?' can't be used as supertype because it is nullable.
+//  - 'C' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D4 = A with B implements TAlias<C>;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:44:7: Error: The type 'TAlias<B>' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D5 extends A with TAlias<B> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:46:7: Error: The type 'TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N1 on TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:48:7: Error: The type 'prefix.TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N1a on prefix.TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:50:7: Error: The type 'TAlias<prefix.A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N1b on TAlias<prefix.A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:52:7: Error: The type 'TAlias<B>' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N2 on A, TAlias<B> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:54:7: Error: The type 'TAlias<B>' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N3 on A implements TAlias<B> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+import self as self;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///nullable_supertypes.dart" as prefix;
+
+typedef AAlias = self::A?;
+typedef BAlias = self::B?;
+typedef CAlias = self::C?;
+typedef TAlias<T extends core::Object? = dynamic> = T?;
+class A extends core::Object {
+  synthetic constructor •() → self::A
+    : super core::Object::•()
+    ;
+}
+class B extends core::Object {
+  synthetic constructor •() → self::B
+    : super core::Object::•()
+    ;
+}
+class C extends core::Object {
+  synthetic constructor •() → self::C
+    : super core::Object::•()
+    ;
+}
+class C1 extends core::Object {
+  synthetic constructor •() → self::C1
+    : super core::Object::•()
+    ;
+}
+class C2 extends core::Object {
+  synthetic constructor •() → self::C2
+    : super core::Object::•()
+    ;
+}
+class C3 extends self::A {
+  synthetic constructor •() → self::C3
+    : super self::A::•()
+    ;
+}
+class C4 = self::A with self::B {
+  synthetic constructor •() → self::C4
+    : super self::A::•()
+    ;
+}
+abstract class _C5&A&BAlias extends self::A /*isAnonymousMixin*/  {
+  synthetic constructor •() → self::_C5&A&BAlias
+    : super self::A::•()
+    ;
+}
+class C5 extends self::_C5&A&BAlias {
+  synthetic constructor •() → self::C5
+    : super self::_C5&A&BAlias::•()
+    ;
+}
+abstract class M1 extends core::Object /*isMixinDeclaration*/  {
+}
+abstract class _M2&A&BAlias extends core::Object implements self::A /*isAnonymousMixin*/  {
+  synthetic constructor •() → self::_M2&A&BAlias
+    : super core::Object::•()
+    ;
+}
+abstract class M2 extends self::_M2&A&BAlias /*isMixinDeclaration*/  {
+}
+abstract class M3 extends self::A /*isMixinDeclaration*/  {
+}
+class D1 extends core::Object {
+  synthetic constructor •() → self::D1
+    : super core::Object::•()
+    ;
+}
+class D1a extends core::Object {
+  synthetic constructor •() → self::D1a
+    : super core::Object::•()
+    ;
+}
+class D1b extends core::Object {
+  synthetic constructor •() → self::D1b
+    : super core::Object::•()
+    ;
+}
+class D2 extends core::Object {
+  synthetic constructor •() → self::D2
+    : super core::Object::•()
+    ;
+}
+class D3 extends self::A {
+  synthetic constructor •() → self::D3
+    : super self::A::•()
+    ;
+}
+class D4 = self::A with self::B {
+  synthetic constructor •() → self::D4
+    : super self::A::•()
+    ;
+}
+abstract class _D5&A&TAlias extends self::A /*isAnonymousMixin*/  {
+  synthetic constructor •() → self::_D5&A&TAlias
+    : super self::A::•()
+    ;
+}
+class D5 extends self::_D5&A&TAlias {
+  synthetic constructor •() → self::D5
+    : super self::_D5&A&TAlias::•()
+    ;
+}
+abstract class N1 extends core::Object /*isMixinDeclaration*/  {
+}
+abstract class N1a extends core::Object /*isMixinDeclaration*/  {
+}
+abstract class N1b extends core::Object /*isMixinDeclaration*/  {
+}
+abstract class _N2&A&TAlias extends core::Object implements self::A /*isAnonymousMixin*/  {
+  synthetic constructor •() → self::_N2&A&TAlias
+    : super core::Object::•()
+    ;
+}
+abstract class N2 extends self::_N2&A&TAlias /*isMixinDeclaration*/  {
+}
+abstract class N3 extends self::A /*isMixinDeclaration*/  {
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart.strong.transformed.expect b/pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart.strong.transformed.expect
new file mode 100644
index 0000000..5dac514
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart.strong.transformed.expect
@@ -0,0 +1,383 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:32:18: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D1 extends TAlias<A> {}
+//                  ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:34:19: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D1a extends prefix.TAlias<A> {}
+//                   ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:36:19: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D1b extends TAlias<prefix.A> {}
+//                   ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:38:21: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D2 implements TAlias<A> {}
+//                     ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:40:19: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D3 = A with TAlias<B>;
+//                   ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:40:7: Error: The type 'TAlias' can't be mixed in.
+// class D3 = A with TAlias<B>;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:42:32: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D4 = A with B implements TAlias<C>;
+//                                ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:44:25: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D5 extends A with TAlias<B> {}
+//                         ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:44:7: Error: The type 'TAlias' can't be mixed in.
+// class D5 extends A with TAlias<B> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:46:13: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N1 on TAlias<A> {}
+//             ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:48:14: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N1a on prefix.TAlias<A> {}
+//              ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:50:14: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N1b on TAlias<prefix.A> {}
+//              ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:52:16: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N2 on A, TAlias<B> {}
+//                ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:54:26: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N3 on A implements TAlias<B> {}
+//                          ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:16:7: Error: The type 'AAlias' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C1 extends AAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:11:9: Context: The issue arises via this type alias.
+// typedef AAlias = A?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:18:7: Error: The type 'AAlias' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C2 implements AAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:11:9: Context: The issue arises via this type alias.
+// typedef AAlias = A?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:20:7: Error: The type 'BAlias' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C3 = A with BAlias;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:12:9: Context: The issue arises via this type alias.
+// typedef BAlias = B?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:22:7: Error: The type 'CAlias' which is an alias of 'C?' can't be used as supertype because it is nullable.
+//  - 'C' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C4 = A with B implements CAlias;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:13:9: Context: The issue arises via this type alias.
+// typedef CAlias = C?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:24:7: Error: The type 'BAlias' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C5 extends A with BAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:12:9: Context: The issue arises via this type alias.
+// typedef BAlias = B?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:26:7: Error: The type 'AAlias' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin M1 on AAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:11:9: Context: The issue arises via this type alias.
+// typedef AAlias = A?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:28:7: Error: The type 'BAlias' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin M2 on A, BAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:12:9: Context: The issue arises via this type alias.
+// typedef BAlias = B?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:30:7: Error: The type 'BAlias' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin M3 on A implements BAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:12:9: Context: The issue arises via this type alias.
+// typedef BAlias = B?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:32:7: Error: The type 'TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D1 extends TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:34:7: Error: The type 'prefix.TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D1a extends prefix.TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:36:7: Error: The type 'TAlias<prefix.A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D1b extends TAlias<prefix.A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:38:7: Error: The type 'TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D2 implements TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:40:7: Error: The type 'TAlias<B>' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D3 = A with TAlias<B>;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:42:7: Error: The type 'TAlias<C>' which is an alias of 'C?' can't be used as supertype because it is nullable.
+//  - 'C' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D4 = A with B implements TAlias<C>;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:44:7: Error: The type 'TAlias<B>' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D5 extends A with TAlias<B> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:46:7: Error: The type 'TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N1 on TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:48:7: Error: The type 'prefix.TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N1a on prefix.TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:50:7: Error: The type 'TAlias<prefix.A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N1b on TAlias<prefix.A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:52:7: Error: The type 'TAlias<B>' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N2 on A, TAlias<B> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:54:7: Error: The type 'TAlias<B>' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N3 on A implements TAlias<B> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+import self as self;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///nullable_supertypes.dart" as prefix;
+
+typedef AAlias = self::A?;
+typedef BAlias = self::B?;
+typedef CAlias = self::C?;
+typedef TAlias<T extends core::Object? = dynamic> = T?;
+class A extends core::Object {
+  synthetic constructor •() → self::A
+    : super core::Object::•()
+    ;
+}
+class B extends core::Object {
+  synthetic constructor •() → self::B
+    : super core::Object::•()
+    ;
+}
+class C extends core::Object {
+  synthetic constructor •() → self::C
+    : super core::Object::•()
+    ;
+}
+class C1 extends core::Object {
+  synthetic constructor •() → self::C1
+    : super core::Object::•()
+    ;
+}
+class C2 extends core::Object {
+  synthetic constructor •() → self::C2
+    : super core::Object::•()
+    ;
+}
+class C3 extends self::A {
+  synthetic constructor •() → self::C3
+    : super self::A::•()
+    ;
+}
+class C4 extends self::A implements self::B /*isEliminatedMixin*/  {
+  synthetic constructor •() → self::C4
+    : super self::A::•()
+    ;
+}
+abstract class _C5&A&BAlias extends self::A /*isAnonymousMixin*/  {
+  synthetic constructor •() → self::_C5&A&BAlias
+    : super self::A::•()
+    ;
+}
+class C5 extends self::_C5&A&BAlias {
+  synthetic constructor •() → self::C5
+    : super self::_C5&A&BAlias::•()
+    ;
+}
+abstract class M1 extends core::Object /*isMixinDeclaration*/  {
+}
+abstract class _M2&A&BAlias extends core::Object implements self::A /*isAnonymousMixin*/  {
+  synthetic constructor •() → self::_M2&A&BAlias
+    : super core::Object::•()
+    ;
+}
+abstract class M2 extends self::_M2&A&BAlias /*isMixinDeclaration*/  {
+}
+abstract class M3 extends self::A /*isMixinDeclaration*/  {
+}
+class D1 extends core::Object {
+  synthetic constructor •() → self::D1
+    : super core::Object::•()
+    ;
+}
+class D1a extends core::Object {
+  synthetic constructor •() → self::D1a
+    : super core::Object::•()
+    ;
+}
+class D1b extends core::Object {
+  synthetic constructor •() → self::D1b
+    : super core::Object::•()
+    ;
+}
+class D2 extends core::Object {
+  synthetic constructor •() → self::D2
+    : super core::Object::•()
+    ;
+}
+class D3 extends self::A {
+  synthetic constructor •() → self::D3
+    : super self::A::•()
+    ;
+}
+class D4 extends self::A implements self::B /*isEliminatedMixin*/  {
+  synthetic constructor •() → self::D4
+    : super self::A::•()
+    ;
+}
+abstract class _D5&A&TAlias extends self::A /*isAnonymousMixin*/  {
+  synthetic constructor •() → self::_D5&A&TAlias
+    : super self::A::•()
+    ;
+}
+class D5 extends self::_D5&A&TAlias {
+  synthetic constructor •() → self::D5
+    : super self::_D5&A&TAlias::•()
+    ;
+}
+abstract class N1 extends core::Object /*isMixinDeclaration*/  {
+}
+abstract class N1a extends core::Object /*isMixinDeclaration*/  {
+}
+abstract class N1b extends core::Object /*isMixinDeclaration*/  {
+}
+abstract class _N2&A&TAlias extends core::Object implements self::A /*isAnonymousMixin*/  {
+  synthetic constructor •() → self::_N2&A&TAlias
+    : super core::Object::•()
+    ;
+}
+abstract class N2 extends self::_N2&A&TAlias /*isMixinDeclaration*/  {
+}
+abstract class N3 extends self::A /*isMixinDeclaration*/  {
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart.textual_outline.expect b/pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart.textual_outline.expect
new file mode 100644
index 0000000..fbfa19f
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart.textual_outline.expect
@@ -0,0 +1,29 @@
+import 'nullable_supertypes.dart' as prefix;
+class A {}
+class B {}
+class C {}
+typedef AAlias = A?;
+typedef BAlias = B?;
+typedef CAlias = C?;
+typedef TAlias<T> = T?;
+class C1 extends AAlias {}
+class C2 implements AAlias {}
+class C3 = A with BAlias;
+class C4 = A with B implements CAlias;
+class C5 extends A with BAlias {}
+mixin M1 on AAlias {}
+mixin M2 on A, BAlias {}
+mixin M3 on A implements BAlias {}
+class D1 extends TAlias<A> {}
+class D1a extends prefix.TAlias<A> {}
+class D1b extends TAlias<prefix.A> {}
+class D2 implements TAlias<A> {}
+class D3 = A with TAlias<B>;
+class D4 = A with B implements TAlias<C>;
+class D5 extends A with TAlias<B> {}
+mixin N1 on TAlias<A> {}
+mixin N1a on prefix.TAlias<A> {}
+mixin N1b on TAlias<prefix.A> {}
+mixin N2 on A, TAlias<B> {}
+mixin N3 on A implements TAlias<B> {}
+main() {}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart.weak.expect b/pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart.weak.expect
new file mode 100644
index 0000000..1a2fe24
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart.weak.expect
@@ -0,0 +1,383 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:32:18: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D1 extends TAlias<A> {}
+//                  ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:34:19: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D1a extends prefix.TAlias<A> {}
+//                   ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:36:19: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D1b extends TAlias<prefix.A> {}
+//                   ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:38:21: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D2 implements TAlias<A> {}
+//                     ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:40:19: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D3 = A with TAlias<B>;
+//                   ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:40:7: Error: The type 'TAlias' can't be mixed in.
+// class D3 = A with TAlias<B>;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:42:32: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D4 = A with B implements TAlias<C>;
+//                                ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:44:25: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D5 extends A with TAlias<B> {}
+//                         ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:44:7: Error: The type 'TAlias' can't be mixed in.
+// class D5 extends A with TAlias<B> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:46:13: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N1 on TAlias<A> {}
+//             ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:48:14: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N1a on prefix.TAlias<A> {}
+//              ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:50:14: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N1b on TAlias<prefix.A> {}
+//              ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:52:16: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N2 on A, TAlias<B> {}
+//                ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:54:26: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N3 on A implements TAlias<B> {}
+//                          ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:16:7: Error: The type 'AAlias' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C1 extends AAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:11:9: Context: The issue arises via this type alias.
+// typedef AAlias = A?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:18:7: Error: The type 'AAlias' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C2 implements AAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:11:9: Context: The issue arises via this type alias.
+// typedef AAlias = A?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:20:7: Error: The type 'BAlias' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C3 = A with BAlias;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:12:9: Context: The issue arises via this type alias.
+// typedef BAlias = B?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:22:7: Error: The type 'CAlias' which is an alias of 'C?' can't be used as supertype because it is nullable.
+//  - 'C' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C4 = A with B implements CAlias;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:13:9: Context: The issue arises via this type alias.
+// typedef CAlias = C?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:24:7: Error: The type 'BAlias' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C5 extends A with BAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:12:9: Context: The issue arises via this type alias.
+// typedef BAlias = B?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:26:7: Error: The type 'AAlias' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin M1 on AAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:11:9: Context: The issue arises via this type alias.
+// typedef AAlias = A?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:28:7: Error: The type 'BAlias' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin M2 on A, BAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:12:9: Context: The issue arises via this type alias.
+// typedef BAlias = B?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:30:7: Error: The type 'BAlias' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin M3 on A implements BAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:12:9: Context: The issue arises via this type alias.
+// typedef BAlias = B?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:32:7: Error: The type 'TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D1 extends TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:34:7: Error: The type 'prefix.TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D1a extends prefix.TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:36:7: Error: The type 'TAlias<prefix.A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D1b extends TAlias<prefix.A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:38:7: Error: The type 'TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D2 implements TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:40:7: Error: The type 'TAlias<B>' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D3 = A with TAlias<B>;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:42:7: Error: The type 'TAlias<C>' which is an alias of 'C?' can't be used as supertype because it is nullable.
+//  - 'C' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D4 = A with B implements TAlias<C>;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:44:7: Error: The type 'TAlias<B>' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D5 extends A with TAlias<B> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:46:7: Error: The type 'TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N1 on TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:48:7: Error: The type 'prefix.TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N1a on prefix.TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:50:7: Error: The type 'TAlias<prefix.A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N1b on TAlias<prefix.A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:52:7: Error: The type 'TAlias<B>' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N2 on A, TAlias<B> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:54:7: Error: The type 'TAlias<B>' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N3 on A implements TAlias<B> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+import self as self;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///nullable_supertypes.dart" as prefix;
+
+typedef AAlias = self::A?;
+typedef BAlias = self::B?;
+typedef CAlias = self::C?;
+typedef TAlias<T extends core::Object? = dynamic> = T?;
+class A extends core::Object {
+  synthetic constructor •() → self::A
+    : super core::Object::•()
+    ;
+}
+class B extends core::Object {
+  synthetic constructor •() → self::B
+    : super core::Object::•()
+    ;
+}
+class C extends core::Object {
+  synthetic constructor •() → self::C
+    : super core::Object::•()
+    ;
+}
+class C1 extends core::Object {
+  synthetic constructor •() → self::C1
+    : super core::Object::•()
+    ;
+}
+class C2 extends core::Object {
+  synthetic constructor •() → self::C2
+    : super core::Object::•()
+    ;
+}
+class C3 extends self::A {
+  synthetic constructor •() → self::C3
+    : super self::A::•()
+    ;
+}
+class C4 = self::A with self::B {
+  synthetic constructor •() → self::C4
+    : super self::A::•()
+    ;
+}
+abstract class _C5&A&BAlias extends self::A /*isAnonymousMixin*/  {
+  synthetic constructor •() → self::_C5&A&BAlias
+    : super self::A::•()
+    ;
+}
+class C5 extends self::_C5&A&BAlias {
+  synthetic constructor •() → self::C5
+    : super self::_C5&A&BAlias::•()
+    ;
+}
+abstract class M1 extends core::Object /*isMixinDeclaration*/  {
+}
+abstract class _M2&A&BAlias extends core::Object implements self::A /*isAnonymousMixin*/  {
+  synthetic constructor •() → self::_M2&A&BAlias
+    : super core::Object::•()
+    ;
+}
+abstract class M2 extends self::_M2&A&BAlias /*isMixinDeclaration*/  {
+}
+abstract class M3 extends self::A /*isMixinDeclaration*/  {
+}
+class D1 extends core::Object {
+  synthetic constructor •() → self::D1
+    : super core::Object::•()
+    ;
+}
+class D1a extends core::Object {
+  synthetic constructor •() → self::D1a
+    : super core::Object::•()
+    ;
+}
+class D1b extends core::Object {
+  synthetic constructor •() → self::D1b
+    : super core::Object::•()
+    ;
+}
+class D2 extends core::Object {
+  synthetic constructor •() → self::D2
+    : super core::Object::•()
+    ;
+}
+class D3 extends self::A {
+  synthetic constructor •() → self::D3
+    : super self::A::•()
+    ;
+}
+class D4 = self::A with self::B {
+  synthetic constructor •() → self::D4
+    : super self::A::•()
+    ;
+}
+abstract class _D5&A&TAlias extends self::A /*isAnonymousMixin*/  {
+  synthetic constructor •() → self::_D5&A&TAlias
+    : super self::A::•()
+    ;
+}
+class D5 extends self::_D5&A&TAlias {
+  synthetic constructor •() → self::D5
+    : super self::_D5&A&TAlias::•()
+    ;
+}
+abstract class N1 extends core::Object /*isMixinDeclaration*/  {
+}
+abstract class N1a extends core::Object /*isMixinDeclaration*/  {
+}
+abstract class N1b extends core::Object /*isMixinDeclaration*/  {
+}
+abstract class _N2&A&TAlias extends core::Object implements self::A /*isAnonymousMixin*/  {
+  synthetic constructor •() → self::_N2&A&TAlias
+    : super core::Object::•()
+    ;
+}
+abstract class N2 extends self::_N2&A&TAlias /*isMixinDeclaration*/  {
+}
+abstract class N3 extends self::A /*isMixinDeclaration*/  {
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart.weak.outline.expect b/pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart.weak.outline.expect
new file mode 100644
index 0000000..a0cf738
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart.weak.outline.expect
@@ -0,0 +1,371 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:32:18: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D1 extends TAlias<A> {}
+//                  ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:34:19: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D1a extends prefix.TAlias<A> {}
+//                   ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:36:19: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D1b extends TAlias<prefix.A> {}
+//                   ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:38:21: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D2 implements TAlias<A> {}
+//                     ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:40:19: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D3 = A with TAlias<B>;
+//                   ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:40:7: Error: The type 'TAlias' can't be mixed in.
+// class D3 = A with TAlias<B>;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:42:32: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D4 = A with B implements TAlias<C>;
+//                                ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:44:25: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D5 extends A with TAlias<B> {}
+//                         ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:44:7: Error: The type 'TAlias' can't be mixed in.
+// class D5 extends A with TAlias<B> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:46:13: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N1 on TAlias<A> {}
+//             ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:48:14: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N1a on prefix.TAlias<A> {}
+//              ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:50:14: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N1b on TAlias<prefix.A> {}
+//              ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:52:16: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N2 on A, TAlias<B> {}
+//                ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:54:26: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N3 on A implements TAlias<B> {}
+//                          ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:16:7: Error: The type 'AAlias' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C1 extends AAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:11:9: Context: The issue arises via this type alias.
+// typedef AAlias = A?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:18:7: Error: The type 'AAlias' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C2 implements AAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:11:9: Context: The issue arises via this type alias.
+// typedef AAlias = A?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:20:7: Error: The type 'BAlias' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C3 = A with BAlias;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:12:9: Context: The issue arises via this type alias.
+// typedef BAlias = B?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:22:7: Error: The type 'CAlias' which is an alias of 'C?' can't be used as supertype because it is nullable.
+//  - 'C' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C4 = A with B implements CAlias;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:13:9: Context: The issue arises via this type alias.
+// typedef CAlias = C?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:24:7: Error: The type 'BAlias' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C5 extends A with BAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:12:9: Context: The issue arises via this type alias.
+// typedef BAlias = B?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:26:7: Error: The type 'AAlias' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin M1 on AAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:11:9: Context: The issue arises via this type alias.
+// typedef AAlias = A?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:28:7: Error: The type 'BAlias' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin M2 on A, BAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:12:9: Context: The issue arises via this type alias.
+// typedef BAlias = B?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:30:7: Error: The type 'BAlias' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin M3 on A implements BAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:12:9: Context: The issue arises via this type alias.
+// typedef BAlias = B?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:32:7: Error: The type 'TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D1 extends TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:34:7: Error: The type 'prefix.TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D1a extends prefix.TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:36:7: Error: The type 'TAlias<prefix.A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D1b extends TAlias<prefix.A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:38:7: Error: The type 'TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D2 implements TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:40:7: Error: The type 'TAlias<B>' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D3 = A with TAlias<B>;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:42:7: Error: The type 'TAlias<C>' which is an alias of 'C?' can't be used as supertype because it is nullable.
+//  - 'C' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D4 = A with B implements TAlias<C>;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:44:7: Error: The type 'TAlias<B>' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D5 extends A with TAlias<B> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:46:7: Error: The type 'TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N1 on TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:48:7: Error: The type 'prefix.TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N1a on prefix.TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:50:7: Error: The type 'TAlias<prefix.A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N1b on TAlias<prefix.A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:52:7: Error: The type 'TAlias<B>' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N2 on A, TAlias<B> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:54:7: Error: The type 'TAlias<B>' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N3 on A implements TAlias<B> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+import self as self;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///nullable_supertypes.dart" as prefix;
+
+typedef AAlias = self::A?;
+typedef BAlias = self::B?;
+typedef CAlias = self::C?;
+typedef TAlias<T extends core::Object? = dynamic> = T?;
+class A extends core::Object {
+  synthetic constructor •() → self::A
+    ;
+}
+class B extends core::Object {
+  synthetic constructor •() → self::B
+    ;
+}
+class C extends core::Object {
+  synthetic constructor •() → self::C
+    ;
+}
+class C1 extends core::Object {
+  synthetic constructor •() → self::C1
+    ;
+}
+class C2 extends core::Object {
+  synthetic constructor •() → self::C2
+    ;
+}
+class C3 extends self::A {
+  synthetic constructor •() → self::C3
+    : super self::A::•()
+    ;
+}
+class C4 = self::A with self::B {
+  synthetic constructor •() → self::C4
+    : super self::A::•()
+    ;
+}
+abstract class _C5&A&BAlias extends self::A /*isAnonymousMixin*/  {
+  synthetic constructor •() → self::_C5&A&BAlias
+    : super self::A::•()
+    ;
+}
+class C5 extends self::_C5&A&BAlias {
+  synthetic constructor •() → self::C5
+    ;
+}
+abstract class M1 extends core::Object /*isMixinDeclaration*/  {
+}
+abstract class _M2&A&BAlias extends core::Object implements self::A /*isAnonymousMixin*/  {
+  synthetic constructor •() → self::_M2&A&BAlias
+    ;
+}
+abstract class M2 extends self::_M2&A&BAlias /*isMixinDeclaration*/  {
+}
+abstract class M3 extends self::A /*isMixinDeclaration*/  {
+}
+class D1 extends core::Object {
+  synthetic constructor •() → self::D1
+    ;
+}
+class D1a extends core::Object {
+  synthetic constructor •() → self::D1a
+    ;
+}
+class D1b extends core::Object {
+  synthetic constructor •() → self::D1b
+    ;
+}
+class D2 extends core::Object {
+  synthetic constructor •() → self::D2
+    ;
+}
+class D3 extends self::A {
+  synthetic constructor •() → self::D3
+    : super self::A::•()
+    ;
+}
+class D4 = self::A with self::B {
+  synthetic constructor •() → self::D4
+    : super self::A::•()
+    ;
+}
+abstract class _D5&A&TAlias extends self::A /*isAnonymousMixin*/  {
+  synthetic constructor •() → self::_D5&A&TAlias
+    : super self::A::•()
+    ;
+}
+class D5 extends self::_D5&A&TAlias {
+  synthetic constructor •() → self::D5
+    ;
+}
+abstract class N1 extends core::Object /*isMixinDeclaration*/  {
+}
+abstract class N1a extends core::Object /*isMixinDeclaration*/  {
+}
+abstract class N1b extends core::Object /*isMixinDeclaration*/  {
+}
+abstract class _N2&A&TAlias extends core::Object implements self::A /*isAnonymousMixin*/  {
+  synthetic constructor •() → self::_N2&A&TAlias
+    ;
+}
+abstract class N2 extends self::_N2&A&TAlias /*isMixinDeclaration*/  {
+}
+abstract class N3 extends self::A /*isMixinDeclaration*/  {
+}
+static method main() → dynamic
+  ;
diff --git a/pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart.weak.transformed.expect b/pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart.weak.transformed.expect
new file mode 100644
index 0000000..5dac514
--- /dev/null
+++ b/pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart.weak.transformed.expect
@@ -0,0 +1,383 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:32:18: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D1 extends TAlias<A> {}
+//                  ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:34:19: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D1a extends prefix.TAlias<A> {}
+//                   ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:36:19: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D1b extends TAlias<prefix.A> {}
+//                   ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:38:21: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D2 implements TAlias<A> {}
+//                     ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:40:19: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D3 = A with TAlias<B>;
+//                   ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:40:7: Error: The type 'TAlias' can't be mixed in.
+// class D3 = A with TAlias<B>;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:42:32: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D4 = A with B implements TAlias<C>;
+//                                ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:44:25: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// class D5 extends A with TAlias<B> {}
+//                         ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:44:7: Error: The type 'TAlias' can't be mixed in.
+// class D5 extends A with TAlias<B> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:46:13: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N1 on TAlias<A> {}
+//             ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:48:14: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N1a on prefix.TAlias<A> {}
+//              ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:50:14: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N1b on TAlias<prefix.A> {}
+//              ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:52:16: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N2 on A, TAlias<B> {}
+//                ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:54:26: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access.
+// mixin N3 on A implements TAlias<B> {}
+//                          ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:16: Context: This is the type variable ultimately denoted.
+// typedef TAlias<T> = T?;
+//                ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:16:7: Error: The type 'AAlias' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C1 extends AAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:11:9: Context: The issue arises via this type alias.
+// typedef AAlias = A?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:18:7: Error: The type 'AAlias' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C2 implements AAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:11:9: Context: The issue arises via this type alias.
+// typedef AAlias = A?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:20:7: Error: The type 'BAlias' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C3 = A with BAlias;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:12:9: Context: The issue arises via this type alias.
+// typedef BAlias = B?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:22:7: Error: The type 'CAlias' which is an alias of 'C?' can't be used as supertype because it is nullable.
+//  - 'C' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C4 = A with B implements CAlias;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:13:9: Context: The issue arises via this type alias.
+// typedef CAlias = C?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:24:7: Error: The type 'BAlias' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class C5 extends A with BAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:12:9: Context: The issue arises via this type alias.
+// typedef BAlias = B?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:26:7: Error: The type 'AAlias' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin M1 on AAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:11:9: Context: The issue arises via this type alias.
+// typedef AAlias = A?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:28:7: Error: The type 'BAlias' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin M2 on A, BAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:12:9: Context: The issue arises via this type alias.
+// typedef BAlias = B?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:30:7: Error: The type 'BAlias' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin M3 on A implements BAlias {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:12:9: Context: The issue arises via this type alias.
+// typedef BAlias = B?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:32:7: Error: The type 'TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D1 extends TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:34:7: Error: The type 'prefix.TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D1a extends prefix.TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:36:7: Error: The type 'TAlias<prefix.A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D1b extends TAlias<prefix.A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:38:7: Error: The type 'TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D2 implements TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:40:7: Error: The type 'TAlias<B>' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D3 = A with TAlias<B>;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:42:7: Error: The type 'TAlias<C>' which is an alias of 'C?' can't be used as supertype because it is nullable.
+//  - 'C' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D4 = A with B implements TAlias<C>;
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:44:7: Error: The type 'TAlias<B>' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// class D5 extends A with TAlias<B> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:46:7: Error: The type 'TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N1 on TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:48:7: Error: The type 'prefix.TAlias<A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N1a on prefix.TAlias<A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:50:7: Error: The type 'TAlias<prefix.A>' which is an alias of 'A?' can't be used as supertype because it is nullable.
+//  - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N1b on TAlias<prefix.A> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:52:7: Error: The type 'TAlias<B>' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N2 on A, TAlias<B> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:54:7: Error: The type 'TAlias<B>' which is an alias of 'B?' can't be used as supertype because it is nullable.
+//  - 'B' is from 'pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart'.
+// mixin N3 on A implements TAlias<B> {}
+//       ^
+// pkg/front_end/testcases/nonfunction_type_aliases/nullable_supertypes.dart:14:9: Context: The issue arises via this type alias.
+// typedef TAlias<T> = T?;
+//         ^
+//
+import self as self;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///nullable_supertypes.dart" as prefix;
+
+typedef AAlias = self::A?;
+typedef BAlias = self::B?;
+typedef CAlias = self::C?;
+typedef TAlias<T extends core::Object? = dynamic> = T?;
+class A extends core::Object {
+  synthetic constructor •() → self::A
+    : super core::Object::•()
+    ;
+}
+class B extends core::Object {
+  synthetic constructor •() → self::B
+    : super core::Object::•()
+    ;
+}
+class C extends core::Object {
+  synthetic constructor •() → self::C
+    : super core::Object::•()
+    ;
+}
+class C1 extends core::Object {
+  synthetic constructor •() → self::C1
+    : super core::Object::•()
+    ;
+}
+class C2 extends core::Object {
+  synthetic constructor •() → self::C2
+    : super core::Object::•()
+    ;
+}
+class C3 extends self::A {
+  synthetic constructor •() → self::C3
+    : super self::A::•()
+    ;
+}
+class C4 extends self::A implements self::B /*isEliminatedMixin*/  {
+  synthetic constructor •() → self::C4
+    : super self::A::•()
+    ;
+}
+abstract class _C5&A&BAlias extends self::A /*isAnonymousMixin*/  {
+  synthetic constructor •() → self::_C5&A&BAlias
+    : super self::A::•()
+    ;
+}
+class C5 extends self::_C5&A&BAlias {
+  synthetic constructor •() → self::C5
+    : super self::_C5&A&BAlias::•()
+    ;
+}
+abstract class M1 extends core::Object /*isMixinDeclaration*/  {
+}
+abstract class _M2&A&BAlias extends core::Object implements self::A /*isAnonymousMixin*/  {
+  synthetic constructor •() → self::_M2&A&BAlias
+    : super core::Object::•()
+    ;
+}
+abstract class M2 extends self::_M2&A&BAlias /*isMixinDeclaration*/  {
+}
+abstract class M3 extends self::A /*isMixinDeclaration*/  {
+}
+class D1 extends core::Object {
+  synthetic constructor •() → self::D1
+    : super core::Object::•()
+    ;
+}
+class D1a extends core::Object {
+  synthetic constructor •() → self::D1a
+    : super core::Object::•()
+    ;
+}
+class D1b extends core::Object {
+  synthetic constructor •() → self::D1b
+    : super core::Object::•()
+    ;
+}
+class D2 extends core::Object {
+  synthetic constructor •() → self::D2
+    : super core::Object::•()
+    ;
+}
+class D3 extends self::A {
+  synthetic constructor •() → self::D3
+    : super self::A::•()
+    ;
+}
+class D4 extends self::A implements self::B /*isEliminatedMixin*/  {
+  synthetic constructor •() → self::D4
+    : super self::A::•()
+    ;
+}
+abstract class _D5&A&TAlias extends self::A /*isAnonymousMixin*/  {
+  synthetic constructor •() → self::_D5&A&TAlias
+    : super self::A::•()
+    ;
+}
+class D5 extends self::_D5&A&TAlias {
+  synthetic constructor •() → self::D5
+    : super self::_D5&A&TAlias::•()
+    ;
+}
+abstract class N1 extends core::Object /*isMixinDeclaration*/  {
+}
+abstract class N1a extends core::Object /*isMixinDeclaration*/  {
+}
+abstract class N1b extends core::Object /*isMixinDeclaration*/  {
+}
+abstract class _N2&A&TAlias extends core::Object implements self::A /*isAnonymousMixin*/  {
+  synthetic constructor •() → self::_N2&A&TAlias
+    : super core::Object::•()
+    ;
+}
+abstract class N2 extends self::_N2&A&TAlias /*isMixinDeclaration*/  {
+}
+abstract class N3 extends self::A /*isMixinDeclaration*/  {
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/textual_outline.status b/pkg/front_end/testcases/textual_outline.status
index b30bc2c..6585a37 100644
--- a/pkg/front_end/testcases/textual_outline.status
+++ b/pkg/front_end/testcases/textual_outline.status
@@ -132,6 +132,7 @@
 nonfunction_type_aliases/issue41501: FormatterCrash
 nonfunction_type_aliases/issue42446: FormatterCrash
 nonfunction_type_aliases/issue45051: FormatterCrash
+nonfunction_type_aliases/nullable_supertypes: FormatterCrash
 nonfunction_type_aliases/unaliased_bounds_checks_in_constructor_calls: FormatterCrash
 rasta/bad_redirection: FormatterCrash
 rasta/issue_000032: FormatterCrash