Version 2.17.0-26.0.dev
Merge commit 'f8b306cf276916981c69ae9667d108ec669695d8' into 'dev'
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
index ea31b84..03930e4 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -1387,6 +1387,11 @@
void _unaliasTypeAliasedConstructorInvocations() {
for (TypeAliasedConstructorInvocation invocation
in typeAliasedConstructorInvocations) {
+ if (!invocation.hasBeenInferred) {
+ assert(
+ isOrphaned(invocation), "Node $invocation has not been inferred.");
+ continue;
+ }
bool inferred = !hasExplicitTypeArguments(invocation.arguments);
DartType aliasedType = new TypedefType(
invocation.typeAliasBuilder.typedef,
@@ -1416,6 +1421,11 @@
typeAliasedFactoryInvocations.toList();
typeAliasedFactoryInvocations.clear();
for (TypeAliasedFactoryInvocation invocation in invocations) {
+ if (!invocation.hasBeenInferred) {
+ assert(
+ isOrphaned(invocation), "Node $invocation has not been inferred.");
+ continue;
+ }
bool inferred = !hasExplicitTypeArguments(invocation.arguments);
DartType aliasedType = new TypedefType(
invocation.typeAliasBuilder.typedef,
@@ -7738,3 +7748,43 @@
return super.visitArguments(node);
}
}
+
+/// Returns `true` if [node] is not part of its parent member.
+///
+/// This computation is costly and should only be used in assertions to verify
+/// that [node] has been removed from the AST.
+bool isOrphaned(TreeNode node) {
+ TreeNode? parent = node;
+ Member? member;
+ while (parent != null) {
+ if (parent is Member) {
+ member = parent;
+ break;
+ }
+ parent = parent.parent;
+ }
+ if (member == null) {
+ return true;
+ }
+ _FindChildVisitor visitor = new _FindChildVisitor(node);
+ member.accept(visitor);
+ return !visitor.foundNode;
+}
+
+class _FindChildVisitor extends Visitor<void> with VisitorVoidMixin {
+ final TreeNode soughtNode;
+ bool foundNode = false;
+
+ _FindChildVisitor(this.soughtNode);
+
+ @override
+ void defaultNode(Node node) {
+ if (!foundNode) {
+ if (identical(node, soughtNode)) {
+ foundNode = true;
+ } else {
+ node.visitChildren(this);
+ }
+ }
+ }
+}
diff --git a/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart b/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart
index 7239b43..9a8570c 100644
--- a/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart
@@ -828,8 +828,19 @@
}
@override
- String toStringInternal() {
- return "";
+ void toTextInternal(AstPrinter printer) {
+ if (isConst) {
+ printer.write('const ');
+ } else {
+ printer.write('new ');
+ }
+ printer.writeTypedefName(typeAliasBuilder.typedef.reference);
+ printer.writeTypeArguments(arguments.types);
+ if (target.name.text.isNotEmpty) {
+ printer.write('.');
+ printer.write(target.name.text);
+ }
+ printer.writeArguments(arguments, includeTypeArguments: false);
}
}
@@ -857,8 +868,19 @@
}
@override
- String toStringInternal() {
- return "";
+ void toTextInternal(AstPrinter printer) {
+ if (isConst) {
+ printer.write('const ');
+ } else {
+ printer.write('new ');
+ }
+ printer.writeTypedefName(typeAliasBuilder.typedef.reference);
+ printer.writeTypeArguments(arguments.types);
+ if (target.name.text.isNotEmpty) {
+ printer.write('.');
+ printer.write(target.name.text);
+ }
+ printer.writeArguments(arguments, includeTypeArguments: false);
}
}
diff --git a/pkg/front_end/test/spell_checking_list_tests.txt b/pkg/front_end/test/spell_checking_list_tests.txt
index dba09e0..3a7144f 100644
--- a/pkg/front_end/test/spell_checking_list_tests.txt
+++ b/pkg/front_end/test/spell_checking_list_tests.txt
@@ -519,6 +519,7 @@
hi
hints
hits
+hkt
home
hoo
hook
diff --git a/pkg/front_end/test/text_representation/internal_ast_text_representation_test.dart b/pkg/front_end/test/text_representation/internal_ast_text_representation_test.dart
index 4fd6fa1..b5fffb7 100644
--- a/pkg/front_end/test/text_representation/internal_ast_text_representation_test.dart
+++ b/pkg/front_end/test/text_representation/internal_ast_text_representation_test.dart
@@ -2,11 +2,24 @@
// 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 'package:_fe_analyzer_shared/src/util/libraries_specification.dart';
import 'package:expect/expect.dart';
+import 'package:front_end/src/base/processed_options.dart';
+import 'package:front_end/src/fasta/builder/type_alias_builder.dart';
+import 'package:front_end/src/fasta/compiler_context.dart';
+import 'package:front_end/src/fasta/dill/dill_library_builder.dart';
+import 'package:front_end/src/fasta/dill/dill_loader.dart';
+import 'package:front_end/src/fasta/dill/dill_target.dart';
+import 'package:front_end/src/fasta/dill/dill_type_alias_builder.dart';
import 'package:front_end/src/fasta/kernel/collections.dart';
import 'package:front_end/src/fasta/kernel/forest.dart';
import 'package:front_end/src/fasta/kernel/internal_ast.dart';
+import 'package:front_end/src/fasta/ticker.dart';
+import 'package:front_end/src/fasta/uri_translator.dart';
import 'package:kernel/ast.dart';
+import 'package:kernel/target/targets.dart';
+import 'package:package_config/package_config.dart';
+
import 'text_representation_test.dart';
void testStatement(Statement node, String normal,
@@ -32,66 +45,71 @@
final Uri dummyUri = Uri.parse('test:dummy');
void main() {
- _testVariableDeclarations();
- _testTryStatement();
- _testForInStatementWithSynthesizedVariable();
- _testSwitchCaseImpl();
- _testBreakStatementImpl();
- _testCascade();
- _testDeferredCheck();
- _testFactoryConstructorInvocationJudgment();
- _testFunctionDeclarationImpl();
- _testIfNullExpression();
- _testIntLiterals();
- _testInternalMethodInvocation();
- _testInternalPropertyGet();
- _testInternalPropertySet();
- _testExpressionInvocation();
- _testNamedFunctionExpressionJudgment();
- _testNullAwareMethodInvocation();
- _testNullAwarePropertyGet();
- _testNullAwarePropertySet();
- _testReturnStatementImpl();
- _testVariableDeclarationImpl();
- _testVariableGetImpl();
- _testLoadLibraryImpl();
- _testLoadLibraryTearOff();
- _testIfNullPropertySet();
- _testIfNullSet();
- _testCompoundExtensionSet();
- _testCompoundPropertySet();
- _testPropertyPostIncDec();
- _testLocalPostIncDec();
- _testStaticPostIncDec();
- _testSuperPostIncDec();
- _testIndexGet();
- _testIndexSet();
- _testSuperIndexSet();
- _testExtensionIndexSet();
- _testIfNullIndexSet();
- _testIfNullSuperIndexSet();
- _testIfNullExtensionIndexSet();
- _testCompoundIndexSet();
- _testNullAwareCompoundSet();
- _testNullAwareIfNullSet();
- _testCompoundSuperIndexSet();
- _testCompoundExtensionIndexSet();
- _testExtensionSet();
- _testNullAwareExtension();
- _testPropertySetImpl();
- _testExtensionTearOff();
- _testEqualsExpression();
- _testBinaryExpression();
- _testUnaryExpression();
- _testParenthesizedExpression();
- _testSpreadElement();
- _testIfElement();
- _testForElement();
- _testForInElement();
- _testSpreadMapEntry();
- _testIfMapEntry();
- _testForMapEntry();
- _testForInMapEntry();
+ CompilerContext.runWithOptions(new ProcessedOptions(inputs: [dummyUri]),
+ (_) async {
+ _testVariableDeclarations();
+ _testTryStatement();
+ _testForInStatementWithSynthesizedVariable();
+ _testSwitchCaseImpl();
+ _testBreakStatementImpl();
+ _testCascade();
+ _testDeferredCheck();
+ _testFactoryConstructorInvocationJudgment();
+ _testTypeAliasedConstructorInvocation();
+ _testTypeAliasedFactoryInvocation();
+ _testFunctionDeclarationImpl();
+ _testIfNullExpression();
+ _testIntLiterals();
+ _testInternalMethodInvocation();
+ _testInternalPropertyGet();
+ _testInternalPropertySet();
+ _testExpressionInvocation();
+ _testNamedFunctionExpressionJudgment();
+ _testNullAwareMethodInvocation();
+ _testNullAwarePropertyGet();
+ _testNullAwarePropertySet();
+ _testReturnStatementImpl();
+ _testVariableDeclarationImpl();
+ _testVariableGetImpl();
+ _testLoadLibraryImpl();
+ _testLoadLibraryTearOff();
+ _testIfNullPropertySet();
+ _testIfNullSet();
+ _testCompoundExtensionSet();
+ _testCompoundPropertySet();
+ _testPropertyPostIncDec();
+ _testLocalPostIncDec();
+ _testStaticPostIncDec();
+ _testSuperPostIncDec();
+ _testIndexGet();
+ _testIndexSet();
+ _testSuperIndexSet();
+ _testExtensionIndexSet();
+ _testIfNullIndexSet();
+ _testIfNullSuperIndexSet();
+ _testIfNullExtensionIndexSet();
+ _testCompoundIndexSet();
+ _testNullAwareCompoundSet();
+ _testNullAwareIfNullSet();
+ _testCompoundSuperIndexSet();
+ _testCompoundExtensionIndexSet();
+ _testExtensionSet();
+ _testNullAwareExtension();
+ _testPropertySetImpl();
+ _testExtensionTearOff();
+ _testEqualsExpression();
+ _testBinaryExpression();
+ _testUnaryExpression();
+ _testParenthesizedExpression();
+ _testSpreadElement();
+ _testIfElement();
+ _testForElement();
+ _testForInElement();
+ _testSpreadMapEntry();
+ _testIfMapEntry();
+ _testForMapEntry();
+ _testForInMapEntry();
+ });
}
void _testVariableDeclarations() {
@@ -355,6 +373,147 @@
new library test:dummy::Class<void>.foo(0, bar: 1)''');
}
+void _testTypeAliasedConstructorInvocation() {
+ DillTarget dillTarget = new DillTarget(
+ new Ticker(),
+ new UriTranslator(
+ new TargetLibrariesSpecification('dummy'), new PackageConfig([])),
+ new NoneTarget(new TargetFlags()));
+ DillLoader dillLoader = new DillLoader(dillTarget);
+ Library library = new Library(dummyUri, fileUri: dummyUri);
+ Class cls = new Class(name: 'Class', fileUri: dummyUri);
+ library.addClass(cls);
+ Constructor constructor = new Constructor(new FunctionNode(null),
+ name: new Name(''), fileUri: dummyUri);
+ cls.addConstructor(constructor);
+ DillLibraryBuilder libraryBuilder =
+ new DillLibraryBuilder(library, dillLoader);
+ Typedef typedef = new Typedef(
+ 'Typedef', new InterfaceType(cls, Nullability.nonNullable),
+ fileUri: dummyUri);
+ library.addTypedef(typedef);
+ TypeAliasBuilder typeAliasBuilder =
+ new DillTypeAliasBuilder(typedef, null, libraryBuilder);
+
+ testExpression(
+ new TypeAliasedConstructorInvocation(
+ typeAliasBuilder, constructor, new ArgumentsImpl([])),
+ '''
+new Typedef()''',
+ verbose: '''
+new library test:dummy::Typedef()''');
+
+ testExpression(
+ new TypeAliasedConstructorInvocation(
+ typeAliasBuilder,
+ constructor,
+ new ArgumentsImpl([new IntLiteral(0)],
+ types: [const VoidType()],
+ named: [new NamedExpression('bar', new IntLiteral(1))])),
+ '''
+new Typedef<void>(0, bar: 1)''',
+ verbose: '''
+new library test:dummy::Typedef<void>(0, bar: 1)''');
+
+ constructor.name = new Name('foo');
+ testExpression(
+ new TypeAliasedConstructorInvocation(
+ typeAliasBuilder,
+ constructor,
+ new ArgumentsImpl([new IntLiteral(0)],
+ types: [const VoidType()],
+ named: [new NamedExpression('bar', new IntLiteral(1))])),
+ '''
+new Typedef<void>.foo(0, bar: 1)''',
+ verbose: '''
+new library test:dummy::Typedef<void>.foo(0, bar: 1)''');
+
+ constructor.name = new Name('foo');
+ testExpression(
+ new TypeAliasedConstructorInvocation(
+ typeAliasBuilder,
+ constructor,
+ new ArgumentsImpl([new IntLiteral(0)],
+ types: [const VoidType()],
+ named: [new NamedExpression('bar', new IntLiteral(1))]),
+ isConst: true),
+ '''
+const Typedef<void>.foo(0, bar: 1)''',
+ verbose: '''
+const library test:dummy::Typedef<void>.foo(0, bar: 1)''');
+}
+
+void _testTypeAliasedFactoryInvocation() {
+ DillTarget dillTarget = new DillTarget(
+ new Ticker(),
+ new UriTranslator(
+ new TargetLibrariesSpecification('dummy'), new PackageConfig([])),
+ new NoneTarget(new TargetFlags()));
+ DillLoader dillLoader = new DillLoader(dillTarget);
+ Library library = new Library(dummyUri, fileUri: dummyUri);
+ Class cls = new Class(name: 'Class', fileUri: dummyUri);
+ library.addClass(cls);
+ Procedure factoryConstructor = new Procedure(
+ new Name(''), ProcedureKind.Factory, new FunctionNode(null),
+ fileUri: dummyUri);
+ cls.addProcedure(factoryConstructor);
+ DillLibraryBuilder libraryBuilder =
+ new DillLibraryBuilder(library, dillLoader);
+ Typedef typedef = new Typedef(
+ 'Typedef', new InterfaceType(cls, Nullability.nonNullable),
+ fileUri: dummyUri);
+ library.addTypedef(typedef);
+ TypeAliasBuilder typeAliasBuilder =
+ new DillTypeAliasBuilder(typedef, null, libraryBuilder);
+
+ testExpression(
+ new TypeAliasedFactoryInvocation(
+ typeAliasBuilder, factoryConstructor, new ArgumentsImpl([])),
+ '''
+new Typedef()''',
+ verbose: '''
+new library test:dummy::Typedef()''');
+
+ testExpression(
+ new TypeAliasedFactoryInvocation(
+ typeAliasBuilder,
+ factoryConstructor,
+ new ArgumentsImpl([new IntLiteral(0)],
+ types: [const VoidType()],
+ named: [new NamedExpression('bar', new IntLiteral(1))])),
+ '''
+new Typedef<void>(0, bar: 1)''',
+ verbose: '''
+new library test:dummy::Typedef<void>(0, bar: 1)''');
+
+ factoryConstructor.name = new Name('foo');
+ testExpression(
+ new TypeAliasedFactoryInvocation(
+ typeAliasBuilder,
+ factoryConstructor,
+ new ArgumentsImpl([new IntLiteral(0)],
+ types: [const VoidType()],
+ named: [new NamedExpression('bar', new IntLiteral(1))])),
+ '''
+new Typedef<void>.foo(0, bar: 1)''',
+ verbose: '''
+new library test:dummy::Typedef<void>.foo(0, bar: 1)''');
+
+ factoryConstructor.name = new Name('foo');
+ testExpression(
+ new TypeAliasedFactoryInvocation(
+ typeAliasBuilder,
+ factoryConstructor,
+ new ArgumentsImpl([new IntLiteral(0)],
+ types: [const VoidType()],
+ named: [new NamedExpression('bar', new IntLiteral(1))]),
+ isConst: true),
+ '''
+const Typedef<void>.foo(0, bar: 1)''',
+ verbose: '''
+const library test:dummy::Typedef<void>.foo(0, bar: 1)''');
+}
+
void _testFunctionDeclarationImpl() {
testStatement(
new FunctionDeclarationImpl(new VariableDeclarationImpl('foo', 0),
diff --git a/pkg/front_end/testcases/general/issue48148.dart b/pkg/front_end/testcases/general/issue48148.dart
new file mode 100644
index 0000000..0cf1e2c
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue48148.dart
@@ -0,0 +1,66 @@
+// Copyright (c) 2022, 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.
+
+const HInvalid invalidExample = HInvalidComposite(
+ [
+ HInvalidLeaf(0),
+ HInvalidChild(
+ HInvalidLeaf(0),
+ ),
+ HInvalidError("error message"),
+ ],
+);
+
+typedef HInvalid = HBase<HKindInvalid>;
+typedef HInvalidComposite<CHILD extends HInvalid>
+ = HBaseComposite<HKindInvalid, CHILD>;
+typedef HInvalidChild<CHILD extends HInvalid> = HBaseChild<HKindInvalid, CHILD>;
+typedef HInvalidLeaf = HBaseLeaf<HKindInvalid>;
+typedef HInvalidError = HBaseError<HKindInvalid>;
+
+abstract class HBase<HKT extends HKind> implements Kind<HKT> {}
+
+class HBaseComposite<HKT extends HKindValid, CHILD extends HBase<HKT>>
+ implements HBase<HKT> {
+ final List<CHILD> children;
+
+ const HBaseComposite(
+ final this.children,
+ );
+}
+
+class HBaseChild<HKT extends HKindValid, CHILD extends HBase<HKT>>
+ implements HBase<HKT> {
+ final CHILD child;
+
+ const HBaseChild(
+ final this.child,
+ );
+}
+
+class HBaseLeaf<HKT extends HKindValid> implements HBase<HKT> {
+ final int data;
+
+ const HBaseLeaf(
+ final this.data,
+ );
+}
+
+class HBaseError<HKT extends HKindInvalid> implements HBase<HKT> {
+ final String errorMessage;
+
+ const HBaseError(
+ final this.errorMessage,
+ );
+}
+
+abstract class Kind<HKT extends HKind> {}
+
+abstract class HKind {}
+
+abstract class HKindValid implements HKind {}
+
+abstract class HKindInvalid implements HKindValid {}
+
+main() {}
diff --git a/pkg/front_end/testcases/general/issue48148.dart.textual_outline.expect b/pkg/front_end/testcases/general/issue48148.dart.textual_outline.expect
new file mode 100644
index 0000000..14cef3d
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue48148.dart.textual_outline.expect
@@ -0,0 +1,57 @@
+const HInvalid invalidExample = HInvalidComposite(
+ [
+ HInvalidLeaf(0),
+ HInvalidChild(
+ HInvalidLeaf(0),
+ ),
+ HInvalidError("error message"),
+ ],
+);
+typedef HInvalid = HBase<HKindInvalid>;
+typedef HInvalidComposite<CHILD extends HInvalid>
+ = HBaseComposite<HKindInvalid, CHILD>;
+typedef HInvalidChild<CHILD extends HInvalid> = HBaseChild<HKindInvalid, CHILD>;
+typedef HInvalidLeaf = HBaseLeaf<HKindInvalid>;
+typedef HInvalidError = HBaseError<HKindInvalid>;
+
+abstract class HBase<HKT extends HKind> implements Kind<HKT> {}
+
+class HBaseComposite<HKT extends HKindValid, CHILD extends HBase<HKT>>
+ implements HBase<HKT> {
+ final List<CHILD> children;
+ const HBaseComposite(
+ final this.children,
+ );
+}
+
+class HBaseChild<HKT extends HKindValid, CHILD extends HBase<HKT>>
+ implements HBase<HKT> {
+ final CHILD child;
+ const HBaseChild(
+ final this.child,
+ );
+}
+
+class HBaseLeaf<HKT extends HKindValid> implements HBase<HKT> {
+ final int data;
+ const HBaseLeaf(
+ final this.data,
+ );
+}
+
+class HBaseError<HKT extends HKindInvalid> implements HBase<HKT> {
+ final String errorMessage;
+ const HBaseError(
+ final this.errorMessage,
+ );
+}
+
+abstract class Kind<HKT extends HKind> {}
+
+abstract class HKind {}
+
+abstract class HKindValid implements HKind {}
+
+abstract class HKindInvalid implements HKindValid {}
+
+main() {}
diff --git a/pkg/front_end/testcases/general/issue48148.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/general/issue48148.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..937cb18
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue48148.dart.textual_outline_modelled.expect
@@ -0,0 +1,56 @@
+abstract class HBase<HKT extends HKind> implements Kind<HKT> {}
+
+abstract class HKind {}
+
+abstract class HKindInvalid implements HKindValid {}
+
+abstract class HKindValid implements HKind {}
+
+abstract class Kind<HKT extends HKind> {}
+
+class HBaseChild<HKT extends HKindValid, CHILD extends HBase<HKT>>
+ implements HBase<HKT> {
+ const HBaseChild(
+ final this.child,
+ );
+ final CHILD child;
+}
+
+class HBaseComposite<HKT extends HKindValid, CHILD extends HBase<HKT>>
+ implements HBase<HKT> {
+ const HBaseComposite(
+ final this.children,
+ );
+ final List<CHILD> children;
+}
+
+class HBaseError<HKT extends HKindInvalid> implements HBase<HKT> {
+ const HBaseError(
+ final this.errorMessage,
+ );
+ final String errorMessage;
+}
+
+class HBaseLeaf<HKT extends HKindValid> implements HBase<HKT> {
+ const HBaseLeaf(
+ final this.data,
+ );
+ final int data;
+}
+
+const HInvalid invalidExample = HInvalidComposite(
+ [
+ HInvalidLeaf(0),
+ HInvalidChild(
+ HInvalidLeaf(0),
+ ),
+ HInvalidError("error message"),
+ ],
+);
+main() {}
+typedef HInvalid = HBase<HKindInvalid>;
+typedef HInvalidChild<CHILD extends HInvalid> = HBaseChild<HKindInvalid, CHILD>;
+typedef HInvalidComposite<CHILD extends HInvalid>
+ = HBaseComposite<HKindInvalid, CHILD>;
+typedef HInvalidError = HBaseError<HKindInvalid>;
+typedef HInvalidLeaf = HBaseLeaf<HKindInvalid>;
diff --git a/pkg/front_end/testcases/general/issue48148.dart.weak.expect b/pkg/front_end/testcases/general/issue48148.dart.weak.expect
new file mode 100644
index 0000000..dd37ee2
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue48148.dart.weak.expect
@@ -0,0 +1,83 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+typedef HInvalid = self::HBase<self::HKindInvalid>;
+typedef HInvalidComposite<CHILD extends self::HBase<self::HKindInvalid>> = self::HBaseComposite<self::HKindInvalid, CHILD>;
+typedef HInvalidChild<CHILD extends self::HBase<self::HKindInvalid>> = self::HBaseChild<self::HKindInvalid, CHILD>;
+typedef HInvalidLeaf = self::HBaseLeaf<self::HKindInvalid>;
+typedef HInvalidError = self::HBaseError<self::HKindInvalid>;
+abstract class HBase<HKT extends self::HKind> extends core::Object implements self::Kind<self::HBase::HKT> {
+ synthetic constructor •() → self::HBase<self::HBase::HKT>
+ : super core::Object::•()
+ ;
+}
+class HBaseComposite<HKT extends self::HKindValid, CHILD extends self::HBase<self::HBaseComposite::HKT> = self::HBase<self::HKindValid>> extends core::Object implements self::HBase<self::HBaseComposite::HKT> /*hasConstConstructor*/ {
+ final field core::List<self::HBaseComposite::CHILD> children;
+ const constructor •(final core::List<self::HBaseComposite::CHILD> children) → self::HBaseComposite<self::HBaseComposite::HKT, self::HBaseComposite::CHILD>
+ : self::HBaseComposite::children = children, super core::Object::•()
+ ;
+}
+class HBaseChild<HKT extends self::HKindValid, CHILD extends self::HBase<self::HBaseChild::HKT> = self::HBase<self::HKindValid>> extends core::Object implements self::HBase<self::HBaseChild::HKT> /*hasConstConstructor*/ {
+ final field self::HBaseChild::CHILD child;
+ const constructor •(final self::HBaseChild::CHILD child) → self::HBaseChild<self::HBaseChild::HKT, self::HBaseChild::CHILD>
+ : self::HBaseChild::child = child, super core::Object::•()
+ ;
+}
+class HBaseLeaf<HKT extends self::HKindValid> extends core::Object implements self::HBase<self::HBaseLeaf::HKT> /*hasConstConstructor*/ {
+ final field core::int data;
+ const constructor •(final core::int data) → self::HBaseLeaf<self::HBaseLeaf::HKT>
+ : self::HBaseLeaf::data = data, super core::Object::•()
+ ;
+}
+class HBaseError<HKT extends self::HKindInvalid> extends core::Object implements self::HBase<self::HBaseError::HKT> /*hasConstConstructor*/ {
+ final field core::String errorMessage;
+ const constructor •(final core::String errorMessage) → self::HBaseError<self::HBaseError::HKT>
+ : self::HBaseError::errorMessage = errorMessage, super core::Object::•()
+ ;
+}
+abstract class Kind<HKT extends self::HKind> extends core::Object {
+ synthetic constructor •() → self::Kind<self::Kind::HKT>
+ : super core::Object::•()
+ ;
+}
+abstract class HKind extends core::Object {
+ synthetic constructor •() → self::HKind
+ : super core::Object::•()
+ ;
+}
+abstract class HKindValid extends core::Object implements self::HKind {
+ synthetic constructor •() → self::HKindValid
+ : super core::Object::•()
+ ;
+}
+abstract class HKindInvalid extends core::Object implements self::HKindValid {
+ synthetic constructor •() → self::HKindInvalid
+ : super core::Object::•()
+ ;
+}
+static const field self::HBase<self::HKindInvalid> invalidExample = #C7;
+static method main() → dynamic {}
+static method _#HInvalidComposite#new#tearOff<CHILD extends self::HBase<self::HKindInvalid>>(core::List<self::_#HInvalidComposite#new#tearOff::CHILD> children) → self::HBaseComposite<self::HKindInvalid, self::_#HInvalidComposite#new#tearOff::CHILD>
+ return new self::HBaseComposite::•<self::HKindInvalid, self::_#HInvalidComposite#new#tearOff::CHILD>(children);
+static method _#HInvalidChild#new#tearOff<CHILD extends self::HBase<self::HKindInvalid>>(self::_#HInvalidChild#new#tearOff::CHILD child) → self::HBaseChild<self::HKindInvalid, self::_#HInvalidChild#new#tearOff::CHILD>
+ return new self::HBaseChild::•<self::HKindInvalid, self::_#HInvalidChild#new#tearOff::CHILD>(child);
+
+constants {
+ #C1 = 0
+ #C2 = self::HBaseLeaf<self::HKindInvalid*> {data:#C1}
+ #C3 = self::HBaseChild<self::HKindInvalid*, self::HBaseLeaf<self::HKindInvalid*>*> {child:#C2}
+ #C4 = "error message"
+ #C5 = self::HBaseError<self::HKindInvalid*> {errorMessage:#C4}
+ #C6 = <self::HBase<self::HKindInvalid*>*>[#C2, #C3, #C5]
+ #C7 = self::HBaseComposite<self::HKindInvalid*, self::HBase<self::HKindInvalid*>*> {children:#C6}
+}
+
+
+Constructor coverage from constants:
+org-dartlang-testcase:///issue48148.dart:
+- HBaseLeaf. (from org-dartlang-testcase:///issue48148.dart:45:9)
+- Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart:25:9)
+- HBaseChild. (from org-dartlang-testcase:///issue48148.dart:37:9)
+- HBaseError. (from org-dartlang-testcase:///issue48148.dart:53:9)
+- HBaseComposite. (from org-dartlang-testcase:///issue48148.dart:28:9)
diff --git a/pkg/front_end/testcases/general/issue48148.dart.weak.modular.expect b/pkg/front_end/testcases/general/issue48148.dart.weak.modular.expect
new file mode 100644
index 0000000..dd37ee2
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue48148.dart.weak.modular.expect
@@ -0,0 +1,83 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+typedef HInvalid = self::HBase<self::HKindInvalid>;
+typedef HInvalidComposite<CHILD extends self::HBase<self::HKindInvalid>> = self::HBaseComposite<self::HKindInvalid, CHILD>;
+typedef HInvalidChild<CHILD extends self::HBase<self::HKindInvalid>> = self::HBaseChild<self::HKindInvalid, CHILD>;
+typedef HInvalidLeaf = self::HBaseLeaf<self::HKindInvalid>;
+typedef HInvalidError = self::HBaseError<self::HKindInvalid>;
+abstract class HBase<HKT extends self::HKind> extends core::Object implements self::Kind<self::HBase::HKT> {
+ synthetic constructor •() → self::HBase<self::HBase::HKT>
+ : super core::Object::•()
+ ;
+}
+class HBaseComposite<HKT extends self::HKindValid, CHILD extends self::HBase<self::HBaseComposite::HKT> = self::HBase<self::HKindValid>> extends core::Object implements self::HBase<self::HBaseComposite::HKT> /*hasConstConstructor*/ {
+ final field core::List<self::HBaseComposite::CHILD> children;
+ const constructor •(final core::List<self::HBaseComposite::CHILD> children) → self::HBaseComposite<self::HBaseComposite::HKT, self::HBaseComposite::CHILD>
+ : self::HBaseComposite::children = children, super core::Object::•()
+ ;
+}
+class HBaseChild<HKT extends self::HKindValid, CHILD extends self::HBase<self::HBaseChild::HKT> = self::HBase<self::HKindValid>> extends core::Object implements self::HBase<self::HBaseChild::HKT> /*hasConstConstructor*/ {
+ final field self::HBaseChild::CHILD child;
+ const constructor •(final self::HBaseChild::CHILD child) → self::HBaseChild<self::HBaseChild::HKT, self::HBaseChild::CHILD>
+ : self::HBaseChild::child = child, super core::Object::•()
+ ;
+}
+class HBaseLeaf<HKT extends self::HKindValid> extends core::Object implements self::HBase<self::HBaseLeaf::HKT> /*hasConstConstructor*/ {
+ final field core::int data;
+ const constructor •(final core::int data) → self::HBaseLeaf<self::HBaseLeaf::HKT>
+ : self::HBaseLeaf::data = data, super core::Object::•()
+ ;
+}
+class HBaseError<HKT extends self::HKindInvalid> extends core::Object implements self::HBase<self::HBaseError::HKT> /*hasConstConstructor*/ {
+ final field core::String errorMessage;
+ const constructor •(final core::String errorMessage) → self::HBaseError<self::HBaseError::HKT>
+ : self::HBaseError::errorMessage = errorMessage, super core::Object::•()
+ ;
+}
+abstract class Kind<HKT extends self::HKind> extends core::Object {
+ synthetic constructor •() → self::Kind<self::Kind::HKT>
+ : super core::Object::•()
+ ;
+}
+abstract class HKind extends core::Object {
+ synthetic constructor •() → self::HKind
+ : super core::Object::•()
+ ;
+}
+abstract class HKindValid extends core::Object implements self::HKind {
+ synthetic constructor •() → self::HKindValid
+ : super core::Object::•()
+ ;
+}
+abstract class HKindInvalid extends core::Object implements self::HKindValid {
+ synthetic constructor •() → self::HKindInvalid
+ : super core::Object::•()
+ ;
+}
+static const field self::HBase<self::HKindInvalid> invalidExample = #C7;
+static method main() → dynamic {}
+static method _#HInvalidComposite#new#tearOff<CHILD extends self::HBase<self::HKindInvalid>>(core::List<self::_#HInvalidComposite#new#tearOff::CHILD> children) → self::HBaseComposite<self::HKindInvalid, self::_#HInvalidComposite#new#tearOff::CHILD>
+ return new self::HBaseComposite::•<self::HKindInvalid, self::_#HInvalidComposite#new#tearOff::CHILD>(children);
+static method _#HInvalidChild#new#tearOff<CHILD extends self::HBase<self::HKindInvalid>>(self::_#HInvalidChild#new#tearOff::CHILD child) → self::HBaseChild<self::HKindInvalid, self::_#HInvalidChild#new#tearOff::CHILD>
+ return new self::HBaseChild::•<self::HKindInvalid, self::_#HInvalidChild#new#tearOff::CHILD>(child);
+
+constants {
+ #C1 = 0
+ #C2 = self::HBaseLeaf<self::HKindInvalid*> {data:#C1}
+ #C3 = self::HBaseChild<self::HKindInvalid*, self::HBaseLeaf<self::HKindInvalid*>*> {child:#C2}
+ #C4 = "error message"
+ #C5 = self::HBaseError<self::HKindInvalid*> {errorMessage:#C4}
+ #C6 = <self::HBase<self::HKindInvalid*>*>[#C2, #C3, #C5]
+ #C7 = self::HBaseComposite<self::HKindInvalid*, self::HBase<self::HKindInvalid*>*> {children:#C6}
+}
+
+
+Constructor coverage from constants:
+org-dartlang-testcase:///issue48148.dart:
+- HBaseLeaf. (from org-dartlang-testcase:///issue48148.dart:45:9)
+- Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart:25:9)
+- HBaseChild. (from org-dartlang-testcase:///issue48148.dart:37:9)
+- HBaseError. (from org-dartlang-testcase:///issue48148.dart:53:9)
+- HBaseComposite. (from org-dartlang-testcase:///issue48148.dart:28:9)
diff --git a/pkg/front_end/testcases/general/issue48148.dart.weak.outline.expect b/pkg/front_end/testcases/general/issue48148.dart.weak.outline.expect
new file mode 100644
index 0000000..1048f95
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue48148.dart.weak.outline.expect
@@ -0,0 +1,65 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+typedef HInvalid = self::HBase<self::HKindInvalid>;
+typedef HInvalidComposite<CHILD extends self::HBase<self::HKindInvalid>> = self::HBaseComposite<self::HKindInvalid, CHILD>;
+typedef HInvalidChild<CHILD extends self::HBase<self::HKindInvalid>> = self::HBaseChild<self::HKindInvalid, CHILD>;
+typedef HInvalidLeaf = self::HBaseLeaf<self::HKindInvalid>;
+typedef HInvalidError = self::HBaseError<self::HKindInvalid>;
+abstract class HBase<HKT extends self::HKind> extends core::Object implements self::Kind<self::HBase::HKT> {
+ synthetic constructor •() → self::HBase<self::HBase::HKT>
+ ;
+}
+class HBaseComposite<HKT extends self::HKindValid, CHILD extends self::HBase<self::HBaseComposite::HKT> = self::HBase<self::HKindValid>> extends core::Object implements self::HBase<self::HBaseComposite::HKT> /*hasConstConstructor*/ {
+ final field core::List<self::HBaseComposite::CHILD> children;
+ const constructor •(final core::List<self::HBaseComposite::CHILD> children) → self::HBaseComposite<self::HBaseComposite::HKT, self::HBaseComposite::CHILD>
+ : self::HBaseComposite::children = children, super core::Object::•()
+ ;
+}
+class HBaseChild<HKT extends self::HKindValid, CHILD extends self::HBase<self::HBaseChild::HKT> = self::HBase<self::HKindValid>> extends core::Object implements self::HBase<self::HBaseChild::HKT> /*hasConstConstructor*/ {
+ final field self::HBaseChild::CHILD child;
+ const constructor •(final self::HBaseChild::CHILD child) → self::HBaseChild<self::HBaseChild::HKT, self::HBaseChild::CHILD>
+ : self::HBaseChild::child = child, super core::Object::•()
+ ;
+}
+class HBaseLeaf<HKT extends self::HKindValid> extends core::Object implements self::HBase<self::HBaseLeaf::HKT> /*hasConstConstructor*/ {
+ final field core::int data;
+ const constructor •(final core::int data) → self::HBaseLeaf<self::HBaseLeaf::HKT>
+ : self::HBaseLeaf::data = data, super core::Object::•()
+ ;
+}
+class HBaseError<HKT extends self::HKindInvalid> extends core::Object implements self::HBase<self::HBaseError::HKT> /*hasConstConstructor*/ {
+ final field core::String errorMessage;
+ const constructor •(final core::String errorMessage) → self::HBaseError<self::HBaseError::HKT>
+ : self::HBaseError::errorMessage = errorMessage, super core::Object::•()
+ ;
+}
+abstract class Kind<HKT extends self::HKind> extends core::Object {
+ synthetic constructor •() → self::Kind<self::Kind::HKT>
+ ;
+}
+abstract class HKind extends core::Object {
+ synthetic constructor •() → self::HKind
+ ;
+}
+abstract class HKindValid extends core::Object implements self::HKind {
+ synthetic constructor •() → self::HKindValid
+ ;
+}
+abstract class HKindInvalid extends core::Object implements self::HKindValid {
+ synthetic constructor •() → self::HKindInvalid
+ ;
+}
+static const field self::HBase<self::HKindInvalid> invalidExample = const self::HBaseComposite::•<self::HKindInvalid, self::HBase<self::HKindInvalid>>(const <self::HBase<self::HKindInvalid>>[const self::HBaseLeaf::•<self::HKindInvalid>(0), const self::HBaseChild::•<self::HKindInvalid, self::HBaseLeaf<self::HKindInvalid>>(const self::HBaseLeaf::•<self::HKindInvalid>(0)), const self::HBaseError::•<self::HKindInvalid>("error message")]);
+static method main() → dynamic
+ ;
+static method _#HInvalidComposite#new#tearOff<CHILD extends self::HBase<self::HKindInvalid>>(core::List<self::_#HInvalidComposite#new#tearOff::CHILD> children) → self::HBaseComposite<self::HKindInvalid, self::_#HInvalidComposite#new#tearOff::CHILD>
+ return new self::HBaseComposite::•<self::HKindInvalid, self::_#HInvalidComposite#new#tearOff::CHILD>(children);
+static method _#HInvalidChild#new#tearOff<CHILD extends self::HBase<self::HKindInvalid>>(self::_#HInvalidChild#new#tearOff::CHILD child) → self::HBaseChild<self::HKindInvalid, self::_#HInvalidChild#new#tearOff::CHILD>
+ return new self::HBaseChild::•<self::HKindInvalid, self::_#HInvalidChild#new#tearOff::CHILD>(child);
+
+
+Extra constant evaluation status:
+Evaluated: ConstructorInvocation @ org-dartlang-testcase:///issue48148.dart:5:16 -> InstanceConstant(const HBaseComposite<HKindInvalid*, HBase<HKindInvalid*>*>{HBaseComposite.children: const <HBase<HKindInvalid*>*>[const HBaseLeaf<HKindInvalid*>{HBaseLeaf.data: 0}, const HBaseChild<HKindInvalid*, HBaseLeaf<HKindInvalid*>*>{HBaseChild.child: const HBaseLeaf<HKindInvalid*>{HBaseLeaf.data: 0}}, const HBaseError<HKindInvalid*>{HBaseError.errorMessage: "error message"}]})
+Extra constant evaluation: evaluated: 9, effectively constant: 1
diff --git a/pkg/front_end/testcases/general/issue48148.dart.weak.transformed.expect b/pkg/front_end/testcases/general/issue48148.dart.weak.transformed.expect
new file mode 100644
index 0000000..dd37ee2
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue48148.dart.weak.transformed.expect
@@ -0,0 +1,83 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+typedef HInvalid = self::HBase<self::HKindInvalid>;
+typedef HInvalidComposite<CHILD extends self::HBase<self::HKindInvalid>> = self::HBaseComposite<self::HKindInvalid, CHILD>;
+typedef HInvalidChild<CHILD extends self::HBase<self::HKindInvalid>> = self::HBaseChild<self::HKindInvalid, CHILD>;
+typedef HInvalidLeaf = self::HBaseLeaf<self::HKindInvalid>;
+typedef HInvalidError = self::HBaseError<self::HKindInvalid>;
+abstract class HBase<HKT extends self::HKind> extends core::Object implements self::Kind<self::HBase::HKT> {
+ synthetic constructor •() → self::HBase<self::HBase::HKT>
+ : super core::Object::•()
+ ;
+}
+class HBaseComposite<HKT extends self::HKindValid, CHILD extends self::HBase<self::HBaseComposite::HKT> = self::HBase<self::HKindValid>> extends core::Object implements self::HBase<self::HBaseComposite::HKT> /*hasConstConstructor*/ {
+ final field core::List<self::HBaseComposite::CHILD> children;
+ const constructor •(final core::List<self::HBaseComposite::CHILD> children) → self::HBaseComposite<self::HBaseComposite::HKT, self::HBaseComposite::CHILD>
+ : self::HBaseComposite::children = children, super core::Object::•()
+ ;
+}
+class HBaseChild<HKT extends self::HKindValid, CHILD extends self::HBase<self::HBaseChild::HKT> = self::HBase<self::HKindValid>> extends core::Object implements self::HBase<self::HBaseChild::HKT> /*hasConstConstructor*/ {
+ final field self::HBaseChild::CHILD child;
+ const constructor •(final self::HBaseChild::CHILD child) → self::HBaseChild<self::HBaseChild::HKT, self::HBaseChild::CHILD>
+ : self::HBaseChild::child = child, super core::Object::•()
+ ;
+}
+class HBaseLeaf<HKT extends self::HKindValid> extends core::Object implements self::HBase<self::HBaseLeaf::HKT> /*hasConstConstructor*/ {
+ final field core::int data;
+ const constructor •(final core::int data) → self::HBaseLeaf<self::HBaseLeaf::HKT>
+ : self::HBaseLeaf::data = data, super core::Object::•()
+ ;
+}
+class HBaseError<HKT extends self::HKindInvalid> extends core::Object implements self::HBase<self::HBaseError::HKT> /*hasConstConstructor*/ {
+ final field core::String errorMessage;
+ const constructor •(final core::String errorMessage) → self::HBaseError<self::HBaseError::HKT>
+ : self::HBaseError::errorMessage = errorMessage, super core::Object::•()
+ ;
+}
+abstract class Kind<HKT extends self::HKind> extends core::Object {
+ synthetic constructor •() → self::Kind<self::Kind::HKT>
+ : super core::Object::•()
+ ;
+}
+abstract class HKind extends core::Object {
+ synthetic constructor •() → self::HKind
+ : super core::Object::•()
+ ;
+}
+abstract class HKindValid extends core::Object implements self::HKind {
+ synthetic constructor •() → self::HKindValid
+ : super core::Object::•()
+ ;
+}
+abstract class HKindInvalid extends core::Object implements self::HKindValid {
+ synthetic constructor •() → self::HKindInvalid
+ : super core::Object::•()
+ ;
+}
+static const field self::HBase<self::HKindInvalid> invalidExample = #C7;
+static method main() → dynamic {}
+static method _#HInvalidComposite#new#tearOff<CHILD extends self::HBase<self::HKindInvalid>>(core::List<self::_#HInvalidComposite#new#tearOff::CHILD> children) → self::HBaseComposite<self::HKindInvalid, self::_#HInvalidComposite#new#tearOff::CHILD>
+ return new self::HBaseComposite::•<self::HKindInvalid, self::_#HInvalidComposite#new#tearOff::CHILD>(children);
+static method _#HInvalidChild#new#tearOff<CHILD extends self::HBase<self::HKindInvalid>>(self::_#HInvalidChild#new#tearOff::CHILD child) → self::HBaseChild<self::HKindInvalid, self::_#HInvalidChild#new#tearOff::CHILD>
+ return new self::HBaseChild::•<self::HKindInvalid, self::_#HInvalidChild#new#tearOff::CHILD>(child);
+
+constants {
+ #C1 = 0
+ #C2 = self::HBaseLeaf<self::HKindInvalid*> {data:#C1}
+ #C3 = self::HBaseChild<self::HKindInvalid*, self::HBaseLeaf<self::HKindInvalid*>*> {child:#C2}
+ #C4 = "error message"
+ #C5 = self::HBaseError<self::HKindInvalid*> {errorMessage:#C4}
+ #C6 = <self::HBase<self::HKindInvalid*>*>[#C2, #C3, #C5]
+ #C7 = self::HBaseComposite<self::HKindInvalid*, self::HBase<self::HKindInvalid*>*> {children:#C6}
+}
+
+
+Constructor coverage from constants:
+org-dartlang-testcase:///issue48148.dart:
+- HBaseLeaf. (from org-dartlang-testcase:///issue48148.dart:45:9)
+- Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart:25:9)
+- HBaseChild. (from org-dartlang-testcase:///issue48148.dart:37:9)
+- HBaseError. (from org-dartlang-testcase:///issue48148.dart:53:9)
+- HBaseComposite. (from org-dartlang-testcase:///issue48148.dart:28:9)
diff --git a/tools/VERSION b/tools/VERSION
index 78a60d7..90e394e 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 17
PATCH 0
-PRERELEASE 25
+PRERELEASE 26
PRERELEASE_PATCH 0
\ No newline at end of file