[cfe] Perform checks on factories of extension type declarations

Closes https://github.com/dart-lang/sdk/issues/53209
Closes https://github.com/dart-lang/sdk/issues/53140
Part of https://github.com/dart-lang/sdk/issues/49731

Change-Id: Ia94b1e85d6775efc23bf732441fa66d4de1de515
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332403
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
This commit is contained in:
Chloe Stefantsova 2023-11-01 10:14:49 +00:00 committed by Commit Queue
parent dd3705d5e8
commit 8b01baab71
33 changed files with 1228 additions and 69 deletions

View file

@ -530,7 +530,8 @@ class KernelTarget extends TargetImplementation {
benchmarker
?.enterPhase(BenchmarkPhases.outline_checkRedirectingFactories);
loader.checkRedirectingFactories(sortedSourceClassBuilders);
loader.checkRedirectingFactories(
sortedSourceClassBuilders, sortedSourceExtensionTypeBuilders);
benchmarker
?.enterPhase(BenchmarkPhases.outline_finishSynthesizedParameters);

View file

@ -32,6 +32,7 @@ import '../util/helpers.dart';
import 'class_declaration.dart';
import 'source_builder_mixins.dart';
import 'source_constructor_builder.dart';
import 'source_factory_builder.dart';
import 'source_field_builder.dart';
import 'source_library_builder.dart';
import 'source_member_builder.dart';
@ -484,6 +485,15 @@ class SourceExtensionTypeDeclarationBuilder
}
}
void checkRedirectingFactories(TypeEnvironment typeEnvironment) {
Iterator<SourceFactoryBuilder> iterator =
constructorScope.filteredIterator<SourceFactoryBuilder>(
parent: this, includeDuplicates: true, includeAugmentations: true);
while (iterator.moveNext()) {
iterator.current.checkRedirectingFactories(typeEnvironment);
}
}
@override
void buildOutlineExpressions(
ClassHierarchy classHierarchy,

View file

@ -336,6 +336,8 @@ class RedirectingFactoryBuilder extends SourceFactoryBuilder {
FreshTypeParameters? _tearOffTypeParameters;
bool _hasBeenCheckedAsRedirectingFactory = false;
RedirectingFactoryBuilder(
List<MetadataBuilder>? metadata,
int modifiers,
@ -737,6 +739,9 @@ class RedirectingFactoryBuilder extends SourceFactoryBuilder {
@override
void _checkRedirectingFactory(TypeEnvironment typeEnvironment) {
if (_hasBeenCheckedAsRedirectingFactory) return;
_hasBeenCheckedAsRedirectingFactory = true;
// Check that factory declaration is not cyclic.
if (_isCyclicRedirectingFactory(this)) {
libraryBuilder.addProblemForRedirectingFactory(
@ -788,6 +793,16 @@ class RedirectingFactoryBuilder extends SourceFactoryBuilder {
return;
}
Builder? redirectionTargetBuilder = redirectionTarget.target;
if (redirectionTargetBuilder is RedirectingFactoryBuilder) {
redirectionTargetBuilder._checkRedirectingFactory(typeEnvironment);
String? errorMessage = redirectionTargetBuilder
.function.redirectingFactoryTarget?.errorMessage;
if (errorMessage != null) {
setRedirectingFactoryError(errorMessage);
}
}
// Redirection to generative enum constructors is forbidden and is reported
// as an error elsewhere.
if (!((classBuilder?.cls.isEnum ?? false) &&

View file

@ -2774,7 +2774,10 @@ severity: $severity
.logMs("Updated ${changedClasses.length} classes in kernel hierarchy");
}
void checkRedirectingFactories(List<SourceClassBuilder> sourceClasses) {
void checkRedirectingFactories(
List<SourceClassBuilder> sourceClasses,
List<SourceExtensionTypeDeclarationBuilder>
sourceExtensionTypeDeclarationBuilders) {
// TODO(ahe): Move this to [ClassHierarchyBuilder].
for (SourceClassBuilder builder in sourceClasses) {
if (builder.libraryBuilder.loader == this && !builder.isPatch) {
@ -2782,6 +2785,13 @@ severity: $severity
typeInferenceEngine.typeSchemaEnvironment);
}
}
for (SourceExtensionTypeDeclarationBuilder builder
in sourceExtensionTypeDeclarationBuilders) {
if (builder.libraryBuilder.loader == this && !builder.isPatch) {
builder.checkRedirectingFactories(
typeInferenceEngine.typeSchemaEnvironment);
}
}
ticker.logMs("Checked redirecting factories");
}

View file

@ -248,7 +248,7 @@ class TypeInferrerImpl implements TypeInferrer {
staticTarget: target);
visitor.checkCleanState();
DartType resultType = result.inferredType;
if (resultType is InterfaceType) {
if (resultType is TypeDeclarationType) {
return resultType.typeArguments;
} else {
return null;

View file

@ -339,6 +339,7 @@ gave
gc
gcd
gclient
ge
gesture
gi
gm

View file

@ -10,9 +10,14 @@ import self as self;
import "dart:core" as core;
abstract class A extends core::Object {
static factory •() → self::A /* redirection-target: self::B::• */
return self::B::•();
static method _#new#tearOff() → self::A;
static factory •() → self::A
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916e.dart:10:23: Error: Redirection constructor target not found: 'C.named'
const factory B() = C.named;
^";
static method _#new#tearOff() → self::A
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916e.dart:10:23: Error: Redirection constructor target not found: 'C.named'
const factory B() = C.named;
^";
}
abstract class B extends core::Object implements self::A {
static factory •() → self::B

View file

@ -10,9 +10,14 @@ import self as self;
import "dart:core" as core;
abstract class A extends core::Object {
static factory •() → self::A /* redirection-target: self::B::• */
return self::B::•();
static method _#new#tearOff() → self::A;
static factory •() → self::A
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916e.dart:10:23: Error: Redirection constructor target not found: 'C.named'
const factory B() = C.named;
^";
static method _#new#tearOff() → self::A
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916e.dart:10:23: Error: Redirection constructor target not found: 'C.named'
const factory B() = C.named;
^";
}
abstract class B extends core::Object implements self::A {
static factory •() → self::B

View file

@ -10,9 +10,14 @@ import self as self;
import "dart:core" as core;
abstract class A extends core::Object {
static factory •() → self::A /* redirection-target: self::B::• */
return self::B::•();
static method _#new#tearOff() → self::A;
static factory •() → self::A
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916e.dart:10:23: Error: Redirection constructor target not found: 'C.named'
const factory B() = C.named;
^";
static method _#new#tearOff() → self::A
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916e.dart:10:23: Error: Redirection constructor target not found: 'C.named'
const factory B() = C.named;
^";
}
abstract class B extends core::Object implements self::A {
static factory •() → self::B

View file

@ -10,9 +10,14 @@ import self as self;
import "dart:core" as core;
abstract class A extends core::Object {
static factory •() → self::A /* redirection-target: self::B::• */
return self::B::•();
static method _#new#tearOff() → self::A;
static factory •() → self::A
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916e.dart:10:23: Error: Redirection constructor target not found: 'C.named'
const factory B() = C.named;
^";
static method _#new#tearOff() → self::A
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916e.dart:10:23: Error: Redirection constructor target not found: 'C.named'
const factory B() = C.named;
^";
}
abstract class B extends core::Object implements self::A {
static factory •() → self::B

View file

@ -10,9 +10,14 @@ import self as self;
import "dart:core" as core;
abstract class A extends core::Object {
static factory •() → self::A /* redirection-target: self::B::• */
return self::B::•();
static method _#new#tearOff() → self::A;
static factory •() → self::A
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916e.dart:10:23: Error: Redirection constructor target not found: 'C.named'
const factory B() = C.named;
^";
static method _#new#tearOff() → self::A
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916e.dart:10:23: Error: Redirection constructor target not found: 'C.named'
const factory B() = C.named;
^";
}
abstract class B extends core::Object implements self::A {
static factory •() → self::B

View file

@ -10,9 +10,14 @@ import self as self;
import "dart:core" as core;
abstract class A extends core::Object {
static factory •() → self::A /* redirection-target: self::B::• */
return self::B::•();
static method _#new#tearOff() → self::A;
static factory •() → self::A
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916e.dart:10:23: Error: Redirection constructor target not found: 'C.named'
const factory B() = C.named;
^";
static method _#new#tearOff() → self::A
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916e.dart:10:23: Error: Redirection constructor target not found: 'C.named'
const factory B() = C.named;
^";
}
abstract class B extends core::Object implements self::A {
static factory •() → self::B

View file

@ -14,9 +14,14 @@ import self as self;
import "dart:core" as core;
abstract class A<T extends core::Object? = dynamic> extends core::Object {
static factory •<T extends core::Object? = dynamic>() → self::A<self::A::•::T%> /* redirection-target: self::B::•<self::A::•::T%>*/
return self::B::•<self::A::•::T%>();
static method _#new#tearOff<T extends core::Object? = dynamic>() → self::A<self::A::_#new#tearOff::T%>;
static factory •<T extends core::Object? = dynamic>() → self::A<self::A::•::T%>
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916f.dart:10:17: Error: Cyclic definition of factory 'B'.
const factory B() = C;
^";
static method _#new#tearOff<T extends core::Object? = dynamic>() → self::A<self::A::_#new#tearOff::T%>
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916f.dart:10:17: Error: Cyclic definition of factory 'B'.
const factory B() = C;
^";
}
abstract class B<T extends core::Object? = dynamic> extends core::Object implements self::A<self::B::T%> {
static factory •<T extends core::Object? = dynamic>() → self::B<self::B::•::T%>

View file

@ -14,9 +14,14 @@ import self as self;
import "dart:core" as core;
abstract class A<T extends core::Object? = dynamic> extends core::Object {
static factory •<T extends core::Object? = dynamic>() → self::A<self::A::•::T%> /* redirection-target: self::B::•<self::A::•::T%>*/
return self::B::•<self::A::•::T%>();
static method _#new#tearOff<T extends core::Object? = dynamic>() → self::A<self::A::_#new#tearOff::T%>;
static factory •<T extends core::Object? = dynamic>() → self::A<self::A::•::T%>
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916f.dart:10:17: Error: Cyclic definition of factory 'B'.
const factory B() = C;
^";
static method _#new#tearOff<T extends core::Object? = dynamic>() → self::A<self::A::_#new#tearOff::T%>
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916f.dart:10:17: Error: Cyclic definition of factory 'B'.
const factory B() = C;
^";
}
abstract class B<T extends core::Object? = dynamic> extends core::Object implements self::A<self::B::T%> {
static factory •<T extends core::Object? = dynamic>() → self::B<self::B::•::T%>

View file

@ -14,9 +14,14 @@ import self as self;
import "dart:core" as core;
abstract class A<T extends core::Object? = dynamic> extends core::Object {
static factory •<T extends core::Object? = dynamic>() → self::A<self::A::•::T%> /* redirection-target: self::B::•<self::A::•::T%>*/
return self::B::•<self::A::•::T%>();
static method _#new#tearOff<T extends core::Object? = dynamic>() → self::A<self::A::_#new#tearOff::T%>;
static factory •<T extends core::Object? = dynamic>() → self::A<self::A::•::T%>
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916f.dart:10:17: Error: Cyclic definition of factory 'B'.
const factory B() = C;
^";
static method _#new#tearOff<T extends core::Object? = dynamic>() → self::A<self::A::_#new#tearOff::T%>
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916f.dart:10:17: Error: Cyclic definition of factory 'B'.
const factory B() = C;
^";
}
abstract class B<T extends core::Object? = dynamic> extends core::Object implements self::A<self::B::T%> {
static factory •<T extends core::Object? = dynamic>() → self::B<self::B::•::T%>

View file

@ -14,9 +14,14 @@ import self as self;
import "dart:core" as core;
abstract class A<T extends core::Object? = dynamic> extends core::Object {
static factory •<T extends core::Object? = dynamic>() → self::A<self::A::•::T%> /* redirection-target: self::B::•<self::A::•::T%>*/
return self::B::•<self::A::•::T%>();
static method _#new#tearOff<T extends core::Object? = dynamic>() → self::A<self::A::_#new#tearOff::T%>;
static factory •<T extends core::Object? = dynamic>() → self::A<self::A::•::T%>
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916f.dart:10:17: Error: Cyclic definition of factory 'B'.
const factory B() = C;
^";
static method _#new#tearOff<T extends core::Object? = dynamic>() → self::A<self::A::_#new#tearOff::T%>
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916f.dart:10:17: Error: Cyclic definition of factory 'B'.
const factory B() = C;
^";
}
abstract class B<T extends core::Object? = dynamic> extends core::Object implements self::A<self::B::T%> {
static factory •<T extends core::Object? = dynamic>() → self::B<self::B::•::T%>

View file

@ -14,9 +14,14 @@ import self as self;
import "dart:core" as core;
abstract class A<T extends core::Object? = dynamic> extends core::Object {
static factory •<T extends core::Object? = dynamic>() → self::A<self::A::•::T%> /* redirection-target: self::B::•<self::A::•::T%>*/
return self::B::•<self::A::•::T%>();
static method _#new#tearOff<T extends core::Object? = dynamic>() → self::A<self::A::_#new#tearOff::T%>;
static factory •<T extends core::Object? = dynamic>() → self::A<self::A::•::T%>
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916f.dart:10:17: Error: Cyclic definition of factory 'B'.
const factory B() = C;
^";
static method _#new#tearOff<T extends core::Object? = dynamic>() → self::A<self::A::_#new#tearOff::T%>
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916f.dart:10:17: Error: Cyclic definition of factory 'B'.
const factory B() = C;
^";
}
abstract class B<T extends core::Object? = dynamic> extends core::Object implements self::A<self::B::T%> {
static factory •<T extends core::Object? = dynamic>() → self::B<self::B::•::T%>

View file

@ -14,9 +14,14 @@ import self as self;
import "dart:core" as core;
abstract class A<T extends core::Object? = dynamic> extends core::Object {
static factory •<T extends core::Object? = dynamic>() → self::A<self::A::•::T%> /* redirection-target: self::B::•<self::A::•::T%>*/
return self::B::•<self::A::•::T%>();
static method _#new#tearOff<T extends core::Object? = dynamic>() → self::A<self::A::_#new#tearOff::T%>;
static factory •<T extends core::Object? = dynamic>() → self::A<self::A::•::T%>
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916f.dart:10:17: Error: Cyclic definition of factory 'B'.
const factory B() = C;
^";
static method _#new#tearOff<T extends core::Object? = dynamic>() → self::A<self::A::_#new#tearOff::T%>
return invalid-expression "pkg/front_end/testcases/dart2js/issue47916f.dart:10:17: Error: Cyclic definition of factory 'B'.
const factory B() = C;
^";
}
abstract class B<T extends core::Object? = dynamic> extends core::Object implements self::A<self::B::T%> {
static factory •<T extends core::Object? = dynamic>() → self::B<self::B::•::T%>

View file

@ -24,7 +24,7 @@ static inline-class-member method ET3|constructor#c1<T extends core::num>() →
}
static inline-class-member method ET3|constructor#_#c1#tearOff<T extends core::num>() → self::ET3<self::ET3|constructor#_#c1#tearOff::T> /* = core::int */
return self::ET3|constructor#c1<self::ET3|constructor#_#c1#tearOff::T>();
static inline-class-member method ET3|constructor#f1<T extends core::num>() → self::ET3<self::ET3|constructor#f1::T> /* = core::int */ /* redirection-target: self::ET3|constructor#c1<dynamic>*/
return self::ET3|constructor#c1<dynamic>();
static inline-class-member method ET3|constructor#f1<T extends core::num>() → self::ET3<self::ET3|constructor#f1::T> /* = core::int */ /* redirection-target: self::ET3|constructor#c1<self::ET3|constructor#f1::T>*/
return self::ET3|constructor#c1<self::ET3|constructor#f1::T>();
static inline-class-member method ET3|constructor#_#f1#tearOff<T extends core::num>() → self::ET3<self::ET3|constructor#_#f1#tearOff::T> /* = core::int */
return self::ET3|constructor#c1<dynamic>();
return self::ET3|constructor#c1<self::ET3|constructor#_#f1#tearOff::T>();

View file

@ -24,13 +24,7 @@ static inline-class-member method ET3|constructor#c1<T extends core::num>() →
}
static inline-class-member method ET3|constructor#_#c1#tearOff<T extends core::num>() → self::ET3<self::ET3|constructor#_#c1#tearOff::T> /* = core::int */
return self::ET3|constructor#c1<self::ET3|constructor#_#c1#tearOff::T>();
static inline-class-member method ET3|constructor#f1<T extends core::num>() → self::ET3<self::ET3|constructor#f1::T> /* = core::int */ /* redirection-target: self::ET3|constructor#c1<dynamic>*/
return self::ET3|constructor#c1<dynamic>();
static inline-class-member method ET3|constructor#f1<T extends core::num>() → self::ET3<self::ET3|constructor#f1::T> /* = core::int */ /* redirection-target: self::ET3|constructor#c1<self::ET3|constructor#f1::T>*/
return self::ET3|constructor#c1<self::ET3|constructor#f1::T>();
static inline-class-member method ET3|constructor#_#f1#tearOff<T extends core::num>() → self::ET3<self::ET3|constructor#_#f1#tearOff::T> /* = core::int */
return self::ET3|constructor#c1<dynamic>();
Extra constant evaluation status:
Evaluated: StaticInvocation @ org-dartlang-testcase:///generic_factory.dart:7:17 -> IntConstant(0)
Evaluated: StaticInvocation @ org-dartlang-testcase:///generic_factory.dart:7:11 -> IntConstant(0)
Extra constant evaluation: evaluated: 10, effectively constant: 2
return self::ET3|constructor#c1<self::ET3|constructor#_#f1#tearOff::T>();

View file

@ -24,7 +24,7 @@ static inline-class-member method ET3|constructor#c1<T extends core::num>() →
}
static inline-class-member method ET3|constructor#_#c1#tearOff<T extends core::num>() → self::ET3<self::ET3|constructor#_#c1#tearOff::T> /* = core::int */
return self::ET3|constructor#c1<self::ET3|constructor#_#c1#tearOff::T>();
static inline-class-member method ET3|constructor#f1<T extends core::num>() → self::ET3<self::ET3|constructor#f1::T> /* = core::int */ /* redirection-target: self::ET3|constructor#c1<dynamic>*/
return self::ET3|constructor#c1<dynamic>();
static inline-class-member method ET3|constructor#f1<T extends core::num>() → self::ET3<self::ET3|constructor#f1::T> /* = core::int */ /* redirection-target: self::ET3|constructor#c1<self::ET3|constructor#f1::T>*/
return self::ET3|constructor#c1<self::ET3|constructor#f1::T>();
static inline-class-member method ET3|constructor#_#f1#tearOff<T extends core::num>() → self::ET3<self::ET3|constructor#_#f1#tearOff::T> /* = core::int */
return self::ET3|constructor#c1<dynamic>();
return self::ET3|constructor#c1<self::ET3|constructor#_#f1#tearOff::T>();

View file

@ -24,7 +24,7 @@ static inline-class-member method ET3|constructor#c1<T extends core::num>() →
}
static inline-class-member method ET3|constructor#_#c1#tearOff<T extends core::num>() → self::ET3<self::ET3|constructor#_#c1#tearOff::T> /* = core::int */
return self::ET3|constructor#c1<self::ET3|constructor#_#c1#tearOff::T>();
static inline-class-member method ET3|constructor#f1<T extends core::num>() → self::ET3<self::ET3|constructor#f1::T> /* = core::int */ /* redirection-target: self::ET3|constructor#c1<dynamic>*/
return self::ET3|constructor#c1<dynamic>();
static inline-class-member method ET3|constructor#f1<T extends core::num>() → self::ET3<self::ET3|constructor#f1::T> /* = core::int */ /* redirection-target: self::ET3|constructor#c1<self::ET3|constructor#f1::T>*/
return self::ET3|constructor#c1<self::ET3|constructor#f1::T>();
static inline-class-member method ET3|constructor#_#f1#tearOff<T extends core::num>() → self::ET3<self::ET3|constructor#_#f1#tearOff::T> /* = core::int */
return self::ET3|constructor#c1<dynamic>();
return self::ET3|constructor#c1<self::ET3|constructor#_#f1#tearOff::T>();

View file

@ -19,7 +19,7 @@ static inline-class-member method ET3|constructor#c1<T extends core::num>() →
;
static inline-class-member method ET3|constructor#_#c1#tearOff<T extends core::num>() → self::ET3<self::ET3|constructor#_#c1#tearOff::T> /* = core::int */
return self::ET3|constructor#c1<self::ET3|constructor#_#c1#tearOff::T>();
static inline-class-member method ET3|constructor#f1<T extends core::num>() → self::ET3<self::ET3|constructor#f1::T> /* = core::int */ /* redirection-target: self::ET3|constructor#c1<dynamic>*/
return self::ET3|constructor#c1<dynamic>();
static inline-class-member method ET3|constructor#f1<T extends core::num>() → self::ET3<self::ET3|constructor#f1::T> /* = core::int */ /* redirection-target: self::ET3|constructor#c1<self::ET3|constructor#f1::T>*/
return self::ET3|constructor#c1<self::ET3|constructor#f1::T>();
static inline-class-member method ET3|constructor#_#f1#tearOff<T extends core::num>() → self::ET3<self::ET3|constructor#_#f1#tearOff::T> /* = core::int */
return self::ET3|constructor#c1<dynamic>();
return self::ET3|constructor#c1<self::ET3|constructor#_#f1#tearOff::T>();

View file

@ -24,13 +24,7 @@ static inline-class-member method ET3|constructor#c1<T extends core::num>() →
}
static inline-class-member method ET3|constructor#_#c1#tearOff<T extends core::num>() → self::ET3<self::ET3|constructor#_#c1#tearOff::T> /* = core::int */
return self::ET3|constructor#c1<self::ET3|constructor#_#c1#tearOff::T>();
static inline-class-member method ET3|constructor#f1<T extends core::num>() → self::ET3<self::ET3|constructor#f1::T> /* = core::int */ /* redirection-target: self::ET3|constructor#c1<dynamic>*/
return self::ET3|constructor#c1<dynamic>();
static inline-class-member method ET3|constructor#f1<T extends core::num>() → self::ET3<self::ET3|constructor#f1::T> /* = core::int */ /* redirection-target: self::ET3|constructor#c1<self::ET3|constructor#f1::T>*/
return self::ET3|constructor#c1<self::ET3|constructor#f1::T>();
static inline-class-member method ET3|constructor#_#f1#tearOff<T extends core::num>() → self::ET3<self::ET3|constructor#_#f1#tearOff::T> /* = core::int */
return self::ET3|constructor#c1<dynamic>();
Extra constant evaluation status:
Evaluated: StaticInvocation @ org-dartlang-testcase:///generic_factory.dart:7:17 -> IntConstant(0)
Evaluated: StaticInvocation @ org-dartlang-testcase:///generic_factory.dart:7:11 -> IntConstant(0)
Extra constant evaluation: evaluated: 10, effectively constant: 2
return self::ET3|constructor#c1<self::ET3|constructor#_#f1#tearOff::T>();

View file

@ -0,0 +1,22 @@
// Copyright (c) 2023, 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.
extension type E(int foo) {
factory E.redirNotEnough() = E; // Error.
factory E.redirTooMany1(int foo, String bar) = E; // Error.
factory E.redirTooMany2(int foo, String bar, num baz) = E; // Error.
factory E.redirTooMany3(int foo, [dynamic bar]) = E; // Error.
factory E.redirTooMany4(int foo, {required Object bar}) = E; // Error.
factory E.redirCyclic1(int foo) = E.redirCyclic2; // Error.
factory E.redirCyclic2(int foo) = E.redirCyclic1; // Error.
factory E.redirCyclicSelf(int foo) = E.redirCyclicSelf; // Error.
}
extension type GE<X>(X foo) {
factory GE.redirNotEnough1() = GE; // Error.
factory GE.redirNotEnough2() = GE.redirNotEnough1; // Should not be reported.
}

View file

@ -0,0 +1,172 @@
library;
//
// Problems in library:
//
// pkg/front_end/testcases/extension_types/issue53209.dart:6:32: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function()'.
// factory E.redirNotEnough() = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:8:50: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String)'.
// factory E.redirTooMany1(int foo, String bar) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:9:59: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String, num)'.
// factory E.redirTooMany2(int foo, String bar, num baz) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:10:53: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, [dynamic])'.
// factory E.redirTooMany3(int foo, [dynamic bar]) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:11:61: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, {Object bar})'.
// - 'Object' is from 'dart:core'.
// factory E.redirTooMany4(int foo, {required Object bar}) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:13:11: Error: Cyclic definition of factory 'E.redirCyclic1'.
// factory E.redirCyclic1(int foo) = E.redirCyclic2; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:14:11: Error: Cyclic definition of factory 'E.redirCyclic2'.
// factory E.redirCyclic2(int foo) = E.redirCyclic1; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:16:11: Error: Cyclic definition of factory 'E.redirCyclicSelf'.
// factory E.redirCyclicSelf(int foo) = E.redirCyclicSelf; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
// factory GE.redirNotEnough1() = GE; // Error.
// ^
//
import self as self;
import "dart:core" as core;
extension type E(core::int foo) {
abstract inline-class-member representation-field get foo() → core::int;
constructor • = self::E|constructor#;
constructor tearoff • = self::E|constructor#_#new#tearOff;
static redirecting-factory redirNotEnough = self::E|constructor#redirNotEnough;
static redirecting-factory tearoff redirNotEnough = self::E|constructor#_#redirNotEnough#tearOff;
static redirecting-factory redirTooMany1 = self::E|constructor#redirTooMany1;
static redirecting-factory tearoff redirTooMany1 = self::E|constructor#_#redirTooMany1#tearOff;
static redirecting-factory redirTooMany2 = self::E|constructor#redirTooMany2;
static redirecting-factory tearoff redirTooMany2 = self::E|constructor#_#redirTooMany2#tearOff;
static redirecting-factory redirTooMany3 = self::E|constructor#redirTooMany3;
static redirecting-factory tearoff redirTooMany3 = self::E|constructor#_#redirTooMany3#tearOff;
static redirecting-factory redirTooMany4 = self::E|constructor#redirTooMany4;
static redirecting-factory tearoff redirTooMany4 = self::E|constructor#_#redirTooMany4#tearOff;
static redirecting-factory redirCyclic1 = self::E|constructor#redirCyclic1;
static redirecting-factory tearoff redirCyclic1 = self::E|constructor#_#redirCyclic1#tearOff;
static redirecting-factory redirCyclic2 = self::E|constructor#redirCyclic2;
static redirecting-factory tearoff redirCyclic2 = self::E|constructor#_#redirCyclic2#tearOff;
static redirecting-factory redirCyclicSelf = self::E|constructor#redirCyclicSelf;
static redirecting-factory tearoff redirCyclicSelf = self::E|constructor#_#redirCyclicSelf#tearOff;
}
extension type GE<X extends core::Object? = dynamic>(X% foo) {
abstract inline-class-member representation-field get foo() → X%;
constructor • = self::GE|constructor#;
constructor tearoff • = self::GE|constructor#_#new#tearOff;
static redirecting-factory redirNotEnough1 = self::GE|constructor#redirNotEnough1;
static redirecting-factory tearoff redirNotEnough1 = self::GE|constructor#_#redirNotEnough1#tearOff;
static redirecting-factory redirNotEnough2 = self::GE|constructor#redirNotEnough2;
static redirecting-factory tearoff redirNotEnough2 = self::GE|constructor#_#redirNotEnough2#tearOff;
}
static inline-class-member method E|constructor#(core::int foo) → self::E /* = core::int */ {
lowered final self::E /* = core::int */ #this = foo;
return #this;
}
static inline-class-member method E|constructor#_#new#tearOff(core::int foo) → self::E /* = core::int */
return self::E|constructor#(foo);
static inline-class-member method E|constructor#redirNotEnough() → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:6:32: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function()'.
factory E.redirNotEnough() = E; // Error.
^";
static inline-class-member method E|constructor#_#redirNotEnough#tearOff() → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:6:32: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function()'.
factory E.redirNotEnough() = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany1(core::int foo, core::String bar = #C1) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:8:50: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String)'.
factory E.redirTooMany1(int foo, String bar) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany1#tearOff(core::int foo, core::String bar = #C1) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:8:50: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String)'.
factory E.redirTooMany1(int foo, String bar) = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany2(core::int foo, core::String bar = #C1, core::num baz = #C1) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:9:59: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String, num)'.
factory E.redirTooMany2(int foo, String bar, num baz) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany2#tearOff(core::int foo, core::String bar = #C1, core::num baz = #C1) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:9:59: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String, num)'.
factory E.redirTooMany2(int foo, String bar, num baz) = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany3(core::int foo, [dynamic bar = #C1]) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:10:53: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, [dynamic])'.
factory E.redirTooMany3(int foo, [dynamic bar]) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany3#tearOff(core::int foo, [dynamic bar = #C1]) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:10:53: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, [dynamic])'.
factory E.redirTooMany3(int foo, [dynamic bar]) = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany4(core::int foo, {required core::Object bar = #C1}) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:11:61: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, {Object bar})'.
- 'Object' is from 'dart:core'.
factory E.redirTooMany4(int foo, {required Object bar}) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany4#tearOff(core::int foo, {required core::Object bar = #C1}) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:11:61: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, {Object bar})'.
- 'Object' is from 'dart:core'.
factory E.redirTooMany4(int foo, {required Object bar}) = E; // Error.
^";
static inline-class-member method E|constructor#redirCyclic1(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:13:11: Error: Cyclic definition of factory 'E.redirCyclic1'.
factory E.redirCyclic1(int foo) = E.redirCyclic2; // Error.
^";
static inline-class-member method E|constructor#_#redirCyclic1#tearOff(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:13:11: Error: Cyclic definition of factory 'E.redirCyclic1'.
factory E.redirCyclic1(int foo) = E.redirCyclic2; // Error.
^";
static inline-class-member method E|constructor#redirCyclic2(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:14:11: Error: Cyclic definition of factory 'E.redirCyclic2'.
factory E.redirCyclic2(int foo) = E.redirCyclic1; // Error.
^";
static inline-class-member method E|constructor#_#redirCyclic2#tearOff(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:14:11: Error: Cyclic definition of factory 'E.redirCyclic2'.
factory E.redirCyclic2(int foo) = E.redirCyclic1; // Error.
^";
static inline-class-member method E|constructor#redirCyclicSelf(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:16:11: Error: Cyclic definition of factory 'E.redirCyclicSelf'.
factory E.redirCyclicSelf(int foo) = E.redirCyclicSelf; // Error.
^";
static inline-class-member method E|constructor#_#redirCyclicSelf#tearOff(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:16:11: Error: Cyclic definition of factory 'E.redirCyclicSelf'.
factory E.redirCyclicSelf(int foo) = E.redirCyclicSelf; // Error.
^";
static inline-class-member method GE|constructor#<X extends core::Object? = dynamic>(self::GE|constructor#::X% foo) → self::GE<self::GE|constructor#::X%> /* = self::GE|constructor#::X% */ {
lowered final self::GE<self::GE|constructor#::X%> /* = self::GE|constructor#::X% */ #this = foo;
return #this;
}
static inline-class-member method GE|constructor#_#new#tearOff<X extends core::Object? = dynamic>(self::GE|constructor#_#new#tearOff::X% foo) → self::GE<self::GE|constructor#_#new#tearOff::X%>% /* = self::GE|constructor#_#new#tearOff::X% */
return self::GE|constructor#<self::GE|constructor#_#new#tearOff::X%>(foo);
static inline-class-member method GE|constructor#redirNotEnough1<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#redirNotEnough1::X%> /* = self::GE|constructor#redirNotEnough1::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
static inline-class-member method GE|constructor#_#redirNotEnough1#tearOff<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#_#redirNotEnough1#tearOff::X%>% /* = self::GE|constructor#_#redirNotEnough1#tearOff::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
static inline-class-member method GE|constructor#redirNotEnough2<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#redirNotEnough2::X%> /* = self::GE|constructor#redirNotEnough2::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
static inline-class-member method GE|constructor#_#redirNotEnough2#tearOff<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#_#redirNotEnough2#tearOff::X%>% /* = self::GE|constructor#_#redirNotEnough2#tearOff::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
constants {
#C1 = null
}

View file

@ -0,0 +1,172 @@
library;
//
// Problems in library:
//
// pkg/front_end/testcases/extension_types/issue53209.dart:6:32: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function()'.
// factory E.redirNotEnough() = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:8:50: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String)'.
// factory E.redirTooMany1(int foo, String bar) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:9:59: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String, num)'.
// factory E.redirTooMany2(int foo, String bar, num baz) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:10:53: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, [dynamic])'.
// factory E.redirTooMany3(int foo, [dynamic bar]) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:11:61: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, {Object bar})'.
// - 'Object' is from 'dart:core'.
// factory E.redirTooMany4(int foo, {required Object bar}) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:13:11: Error: Cyclic definition of factory 'E.redirCyclic1'.
// factory E.redirCyclic1(int foo) = E.redirCyclic2; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:14:11: Error: Cyclic definition of factory 'E.redirCyclic2'.
// factory E.redirCyclic2(int foo) = E.redirCyclic1; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:16:11: Error: Cyclic definition of factory 'E.redirCyclicSelf'.
// factory E.redirCyclicSelf(int foo) = E.redirCyclicSelf; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
// factory GE.redirNotEnough1() = GE; // Error.
// ^
//
import self as self;
import "dart:core" as core;
extension type E(core::int foo) {
abstract inline-class-member representation-field get foo() → core::int;
constructor • = self::E|constructor#;
constructor tearoff • = self::E|constructor#_#new#tearOff;
static redirecting-factory redirNotEnough = self::E|constructor#redirNotEnough;
static redirecting-factory tearoff redirNotEnough = self::E|constructor#_#redirNotEnough#tearOff;
static redirecting-factory redirTooMany1 = self::E|constructor#redirTooMany1;
static redirecting-factory tearoff redirTooMany1 = self::E|constructor#_#redirTooMany1#tearOff;
static redirecting-factory redirTooMany2 = self::E|constructor#redirTooMany2;
static redirecting-factory tearoff redirTooMany2 = self::E|constructor#_#redirTooMany2#tearOff;
static redirecting-factory redirTooMany3 = self::E|constructor#redirTooMany3;
static redirecting-factory tearoff redirTooMany3 = self::E|constructor#_#redirTooMany3#tearOff;
static redirecting-factory redirTooMany4 = self::E|constructor#redirTooMany4;
static redirecting-factory tearoff redirTooMany4 = self::E|constructor#_#redirTooMany4#tearOff;
static redirecting-factory redirCyclic1 = self::E|constructor#redirCyclic1;
static redirecting-factory tearoff redirCyclic1 = self::E|constructor#_#redirCyclic1#tearOff;
static redirecting-factory redirCyclic2 = self::E|constructor#redirCyclic2;
static redirecting-factory tearoff redirCyclic2 = self::E|constructor#_#redirCyclic2#tearOff;
static redirecting-factory redirCyclicSelf = self::E|constructor#redirCyclicSelf;
static redirecting-factory tearoff redirCyclicSelf = self::E|constructor#_#redirCyclicSelf#tearOff;
}
extension type GE<X extends core::Object? = dynamic>(X% foo) {
abstract inline-class-member representation-field get foo() → X%;
constructor • = self::GE|constructor#;
constructor tearoff • = self::GE|constructor#_#new#tearOff;
static redirecting-factory redirNotEnough1 = self::GE|constructor#redirNotEnough1;
static redirecting-factory tearoff redirNotEnough1 = self::GE|constructor#_#redirNotEnough1#tearOff;
static redirecting-factory redirNotEnough2 = self::GE|constructor#redirNotEnough2;
static redirecting-factory tearoff redirNotEnough2 = self::GE|constructor#_#redirNotEnough2#tearOff;
}
static inline-class-member method E|constructor#(core::int foo) → self::E /* = core::int */ {
lowered final self::E /* = core::int */ #this = foo;
return #this;
}
static inline-class-member method E|constructor#_#new#tearOff(core::int foo) → self::E /* = core::int */
return self::E|constructor#(foo);
static inline-class-member method E|constructor#redirNotEnough() → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:6:32: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function()'.
factory E.redirNotEnough() = E; // Error.
^";
static inline-class-member method E|constructor#_#redirNotEnough#tearOff() → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:6:32: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function()'.
factory E.redirNotEnough() = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany1(core::int foo, core::String bar = #C1) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:8:50: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String)'.
factory E.redirTooMany1(int foo, String bar) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany1#tearOff(core::int foo, core::String bar = #C1) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:8:50: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String)'.
factory E.redirTooMany1(int foo, String bar) = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany2(core::int foo, core::String bar = #C1, core::num baz = #C1) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:9:59: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String, num)'.
factory E.redirTooMany2(int foo, String bar, num baz) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany2#tearOff(core::int foo, core::String bar = #C1, core::num baz = #C1) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:9:59: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String, num)'.
factory E.redirTooMany2(int foo, String bar, num baz) = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany3(core::int foo, [dynamic bar = #C1]) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:10:53: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, [dynamic])'.
factory E.redirTooMany3(int foo, [dynamic bar]) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany3#tearOff(core::int foo, [dynamic bar = #C1]) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:10:53: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, [dynamic])'.
factory E.redirTooMany3(int foo, [dynamic bar]) = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany4(core::int foo, {required core::Object bar = #C1}) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:11:61: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, {Object bar})'.
- 'Object' is from 'dart:core'.
factory E.redirTooMany4(int foo, {required Object bar}) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany4#tearOff(core::int foo, {required core::Object bar = #C1}) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:11:61: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, {Object bar})'.
- 'Object' is from 'dart:core'.
factory E.redirTooMany4(int foo, {required Object bar}) = E; // Error.
^";
static inline-class-member method E|constructor#redirCyclic1(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:13:11: Error: Cyclic definition of factory 'E.redirCyclic1'.
factory E.redirCyclic1(int foo) = E.redirCyclic2; // Error.
^";
static inline-class-member method E|constructor#_#redirCyclic1#tearOff(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:13:11: Error: Cyclic definition of factory 'E.redirCyclic1'.
factory E.redirCyclic1(int foo) = E.redirCyclic2; // Error.
^";
static inline-class-member method E|constructor#redirCyclic2(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:14:11: Error: Cyclic definition of factory 'E.redirCyclic2'.
factory E.redirCyclic2(int foo) = E.redirCyclic1; // Error.
^";
static inline-class-member method E|constructor#_#redirCyclic2#tearOff(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:14:11: Error: Cyclic definition of factory 'E.redirCyclic2'.
factory E.redirCyclic2(int foo) = E.redirCyclic1; // Error.
^";
static inline-class-member method E|constructor#redirCyclicSelf(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:16:11: Error: Cyclic definition of factory 'E.redirCyclicSelf'.
factory E.redirCyclicSelf(int foo) = E.redirCyclicSelf; // Error.
^";
static inline-class-member method E|constructor#_#redirCyclicSelf#tearOff(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:16:11: Error: Cyclic definition of factory 'E.redirCyclicSelf'.
factory E.redirCyclicSelf(int foo) = E.redirCyclicSelf; // Error.
^";
static inline-class-member method GE|constructor#<X extends core::Object? = dynamic>(self::GE|constructor#::X% foo) → self::GE<self::GE|constructor#::X%> /* = self::GE|constructor#::X% */ {
lowered final self::GE<self::GE|constructor#::X%> /* = self::GE|constructor#::X% */ #this = foo;
return #this;
}
static inline-class-member method GE|constructor#_#new#tearOff<X extends core::Object? = dynamic>(self::GE|constructor#_#new#tearOff::X% foo) → self::GE<self::GE|constructor#_#new#tearOff::X%>% /* = self::GE|constructor#_#new#tearOff::X% */
return self::GE|constructor#<self::GE|constructor#_#new#tearOff::X%>(foo);
static inline-class-member method GE|constructor#redirNotEnough1<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#redirNotEnough1::X%> /* = self::GE|constructor#redirNotEnough1::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
static inline-class-member method GE|constructor#_#redirNotEnough1#tearOff<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#_#redirNotEnough1#tearOff::X%>% /* = self::GE|constructor#_#redirNotEnough1#tearOff::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
static inline-class-member method GE|constructor#redirNotEnough2<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#redirNotEnough2::X%> /* = self::GE|constructor#redirNotEnough2::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
static inline-class-member method GE|constructor#_#redirNotEnough2#tearOff<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#_#redirNotEnough2#tearOff::X%>% /* = self::GE|constructor#_#redirNotEnough2#tearOff::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
constants {
#C1 = null
}

View file

@ -0,0 +1,14 @@
extension type E(int foo) {
factory E.redirNotEnough() = E;
factory E.redirTooMany1(int foo, String bar) = E;
factory E.redirTooMany2(int foo, String bar, num baz) = E;
factory E.redirTooMany3(int foo, [dynamic bar]) = E;
factory E.redirTooMany4(int foo, {required Object bar}) = E;
factory E.redirCyclic1(int foo) = E.redirCyclic2;
factory E.redirCyclic2(int foo) = E.redirCyclic1;
factory E.redirCyclicSelf(int foo) = E.redirCyclicSelf;
}
extension type GE<X>(X foo) {
factory GE.redirNotEnough1() = GE;
factory GE.redirNotEnough2() = GE.redirNotEnough1;
}

View file

@ -0,0 +1,14 @@
extension type E(int foo) {
factory E.redirCyclic1(int foo) = E.redirCyclic2;
factory E.redirCyclic2(int foo) = E.redirCyclic1;
factory E.redirCyclicSelf(int foo) = E.redirCyclicSelf;
factory E.redirNotEnough() = E;
factory E.redirTooMany1(int foo, String bar) = E;
factory E.redirTooMany2(int foo, String bar, num baz) = E;
factory E.redirTooMany3(int foo, [dynamic bar]) = E;
factory E.redirTooMany4(int foo, {required Object bar}) = E;
}
extension type GE<X>(X foo) {
factory GE.redirNotEnough1() = GE;
factory GE.redirNotEnough2() = GE.redirNotEnough1;
}

View file

@ -0,0 +1,172 @@
library;
//
// Problems in library:
//
// pkg/front_end/testcases/extension_types/issue53209.dart:6:32: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function()'.
// factory E.redirNotEnough() = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:8:50: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String)'.
// factory E.redirTooMany1(int foo, String bar) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:9:59: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String, num)'.
// factory E.redirTooMany2(int foo, String bar, num baz) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:10:53: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, [dynamic])'.
// factory E.redirTooMany3(int foo, [dynamic bar]) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:11:61: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, {Object bar})'.
// - 'Object' is from 'dart:core'.
// factory E.redirTooMany4(int foo, {required Object bar}) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:13:11: Error: Cyclic definition of factory 'E.redirCyclic1'.
// factory E.redirCyclic1(int foo) = E.redirCyclic2; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:14:11: Error: Cyclic definition of factory 'E.redirCyclic2'.
// factory E.redirCyclic2(int foo) = E.redirCyclic1; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:16:11: Error: Cyclic definition of factory 'E.redirCyclicSelf'.
// factory E.redirCyclicSelf(int foo) = E.redirCyclicSelf; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
// factory GE.redirNotEnough1() = GE; // Error.
// ^
//
import self as self;
import "dart:core" as core;
extension type E(core::int foo) {
abstract inline-class-member representation-field get foo() → core::int;
constructor • = self::E|constructor#;
constructor tearoff • = self::E|constructor#_#new#tearOff;
static redirecting-factory redirNotEnough = self::E|constructor#redirNotEnough;
static redirecting-factory tearoff redirNotEnough = self::E|constructor#_#redirNotEnough#tearOff;
static redirecting-factory redirTooMany1 = self::E|constructor#redirTooMany1;
static redirecting-factory tearoff redirTooMany1 = self::E|constructor#_#redirTooMany1#tearOff;
static redirecting-factory redirTooMany2 = self::E|constructor#redirTooMany2;
static redirecting-factory tearoff redirTooMany2 = self::E|constructor#_#redirTooMany2#tearOff;
static redirecting-factory redirTooMany3 = self::E|constructor#redirTooMany3;
static redirecting-factory tearoff redirTooMany3 = self::E|constructor#_#redirTooMany3#tearOff;
static redirecting-factory redirTooMany4 = self::E|constructor#redirTooMany4;
static redirecting-factory tearoff redirTooMany4 = self::E|constructor#_#redirTooMany4#tearOff;
static redirecting-factory redirCyclic1 = self::E|constructor#redirCyclic1;
static redirecting-factory tearoff redirCyclic1 = self::E|constructor#_#redirCyclic1#tearOff;
static redirecting-factory redirCyclic2 = self::E|constructor#redirCyclic2;
static redirecting-factory tearoff redirCyclic2 = self::E|constructor#_#redirCyclic2#tearOff;
static redirecting-factory redirCyclicSelf = self::E|constructor#redirCyclicSelf;
static redirecting-factory tearoff redirCyclicSelf = self::E|constructor#_#redirCyclicSelf#tearOff;
}
extension type GE<X extends core::Object? = dynamic>(X% foo) {
abstract inline-class-member representation-field get foo() → X%;
constructor • = self::GE|constructor#;
constructor tearoff • = self::GE|constructor#_#new#tearOff;
static redirecting-factory redirNotEnough1 = self::GE|constructor#redirNotEnough1;
static redirecting-factory tearoff redirNotEnough1 = self::GE|constructor#_#redirNotEnough1#tearOff;
static redirecting-factory redirNotEnough2 = self::GE|constructor#redirNotEnough2;
static redirecting-factory tearoff redirNotEnough2 = self::GE|constructor#_#redirNotEnough2#tearOff;
}
static inline-class-member method E|constructor#(core::int foo) → self::E /* = core::int */ {
lowered final self::E /* = core::int */ #this = foo;
return #this;
}
static inline-class-member method E|constructor#_#new#tearOff(core::int foo) → self::E /* = core::int */
return self::E|constructor#(foo);
static inline-class-member method E|constructor#redirNotEnough() → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:6:32: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function()'.
factory E.redirNotEnough() = E; // Error.
^";
static inline-class-member method E|constructor#_#redirNotEnough#tearOff() → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:6:32: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function()'.
factory E.redirNotEnough() = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany1(core::int foo, core::String bar = #C1) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:8:50: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String)'.
factory E.redirTooMany1(int foo, String bar) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany1#tearOff(core::int foo, core::String bar = #C1) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:8:50: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String)'.
factory E.redirTooMany1(int foo, String bar) = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany2(core::int foo, core::String bar = #C1, core::num baz = #C1) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:9:59: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String, num)'.
factory E.redirTooMany2(int foo, String bar, num baz) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany2#tearOff(core::int foo, core::String bar = #C1, core::num baz = #C1) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:9:59: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String, num)'.
factory E.redirTooMany2(int foo, String bar, num baz) = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany3(core::int foo, [dynamic bar = #C1]) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:10:53: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, [dynamic])'.
factory E.redirTooMany3(int foo, [dynamic bar]) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany3#tearOff(core::int foo, [dynamic bar = #C1]) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:10:53: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, [dynamic])'.
factory E.redirTooMany3(int foo, [dynamic bar]) = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany4(core::int foo, {required core::Object bar = #C1}) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:11:61: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, {Object bar})'.
- 'Object' is from 'dart:core'.
factory E.redirTooMany4(int foo, {required Object bar}) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany4#tearOff(core::int foo, {required core::Object bar = #C1}) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:11:61: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, {Object bar})'.
- 'Object' is from 'dart:core'.
factory E.redirTooMany4(int foo, {required Object bar}) = E; // Error.
^";
static inline-class-member method E|constructor#redirCyclic1(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:13:11: Error: Cyclic definition of factory 'E.redirCyclic1'.
factory E.redirCyclic1(int foo) = E.redirCyclic2; // Error.
^";
static inline-class-member method E|constructor#_#redirCyclic1#tearOff(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:13:11: Error: Cyclic definition of factory 'E.redirCyclic1'.
factory E.redirCyclic1(int foo) = E.redirCyclic2; // Error.
^";
static inline-class-member method E|constructor#redirCyclic2(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:14:11: Error: Cyclic definition of factory 'E.redirCyclic2'.
factory E.redirCyclic2(int foo) = E.redirCyclic1; // Error.
^";
static inline-class-member method E|constructor#_#redirCyclic2#tearOff(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:14:11: Error: Cyclic definition of factory 'E.redirCyclic2'.
factory E.redirCyclic2(int foo) = E.redirCyclic1; // Error.
^";
static inline-class-member method E|constructor#redirCyclicSelf(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:16:11: Error: Cyclic definition of factory 'E.redirCyclicSelf'.
factory E.redirCyclicSelf(int foo) = E.redirCyclicSelf; // Error.
^";
static inline-class-member method E|constructor#_#redirCyclicSelf#tearOff(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:16:11: Error: Cyclic definition of factory 'E.redirCyclicSelf'.
factory E.redirCyclicSelf(int foo) = E.redirCyclicSelf; // Error.
^";
static inline-class-member method GE|constructor#<X extends core::Object? = dynamic>(self::GE|constructor#::X% foo) → self::GE<self::GE|constructor#::X%> /* = self::GE|constructor#::X% */ {
lowered final self::GE<self::GE|constructor#::X%> /* = self::GE|constructor#::X% */ #this = foo;
return #this;
}
static inline-class-member method GE|constructor#_#new#tearOff<X extends core::Object? = dynamic>(self::GE|constructor#_#new#tearOff::X% foo) → self::GE<self::GE|constructor#_#new#tearOff::X%>% /* = self::GE|constructor#_#new#tearOff::X% */
return self::GE|constructor#<self::GE|constructor#_#new#tearOff::X%>(foo);
static inline-class-member method GE|constructor#redirNotEnough1<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#redirNotEnough1::X%> /* = self::GE|constructor#redirNotEnough1::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
static inline-class-member method GE|constructor#_#redirNotEnough1#tearOff<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#_#redirNotEnough1#tearOff::X%>% /* = self::GE|constructor#_#redirNotEnough1#tearOff::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
static inline-class-member method GE|constructor#redirNotEnough2<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#redirNotEnough2::X%> /* = self::GE|constructor#redirNotEnough2::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
static inline-class-member method GE|constructor#_#redirNotEnough2#tearOff<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#_#redirNotEnough2#tearOff::X%>% /* = self::GE|constructor#_#redirNotEnough2#tearOff::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
constants {
#C1 = null
}

View file

@ -0,0 +1,172 @@
library;
//
// Problems in library:
//
// pkg/front_end/testcases/extension_types/issue53209.dart:6:32: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function()'.
// factory E.redirNotEnough() = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:8:50: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String)'.
// factory E.redirTooMany1(int foo, String bar) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:9:59: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String, num)'.
// factory E.redirTooMany2(int foo, String bar, num baz) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:10:53: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, [dynamic])'.
// factory E.redirTooMany3(int foo, [dynamic bar]) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:11:61: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, {Object bar})'.
// - 'Object' is from 'dart:core'.
// factory E.redirTooMany4(int foo, {required Object bar}) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:13:11: Error: Cyclic definition of factory 'E.redirCyclic1'.
// factory E.redirCyclic1(int foo) = E.redirCyclic2; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:14:11: Error: Cyclic definition of factory 'E.redirCyclic2'.
// factory E.redirCyclic2(int foo) = E.redirCyclic1; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:16:11: Error: Cyclic definition of factory 'E.redirCyclicSelf'.
// factory E.redirCyclicSelf(int foo) = E.redirCyclicSelf; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
// factory GE.redirNotEnough1() = GE; // Error.
// ^
//
import self as self;
import "dart:core" as core;
extension type E(core::int foo) {
abstract inline-class-member representation-field get foo() → core::int;
constructor • = self::E|constructor#;
constructor tearoff • = self::E|constructor#_#new#tearOff;
static redirecting-factory redirNotEnough = self::E|constructor#redirNotEnough;
static redirecting-factory tearoff redirNotEnough = self::E|constructor#_#redirNotEnough#tearOff;
static redirecting-factory redirTooMany1 = self::E|constructor#redirTooMany1;
static redirecting-factory tearoff redirTooMany1 = self::E|constructor#_#redirTooMany1#tearOff;
static redirecting-factory redirTooMany2 = self::E|constructor#redirTooMany2;
static redirecting-factory tearoff redirTooMany2 = self::E|constructor#_#redirTooMany2#tearOff;
static redirecting-factory redirTooMany3 = self::E|constructor#redirTooMany3;
static redirecting-factory tearoff redirTooMany3 = self::E|constructor#_#redirTooMany3#tearOff;
static redirecting-factory redirTooMany4 = self::E|constructor#redirTooMany4;
static redirecting-factory tearoff redirTooMany4 = self::E|constructor#_#redirTooMany4#tearOff;
static redirecting-factory redirCyclic1 = self::E|constructor#redirCyclic1;
static redirecting-factory tearoff redirCyclic1 = self::E|constructor#_#redirCyclic1#tearOff;
static redirecting-factory redirCyclic2 = self::E|constructor#redirCyclic2;
static redirecting-factory tearoff redirCyclic2 = self::E|constructor#_#redirCyclic2#tearOff;
static redirecting-factory redirCyclicSelf = self::E|constructor#redirCyclicSelf;
static redirecting-factory tearoff redirCyclicSelf = self::E|constructor#_#redirCyclicSelf#tearOff;
}
extension type GE<X extends core::Object? = dynamic>(X% foo) {
abstract inline-class-member representation-field get foo() → X%;
constructor • = self::GE|constructor#;
constructor tearoff • = self::GE|constructor#_#new#tearOff;
static redirecting-factory redirNotEnough1 = self::GE|constructor#redirNotEnough1;
static redirecting-factory tearoff redirNotEnough1 = self::GE|constructor#_#redirNotEnough1#tearOff;
static redirecting-factory redirNotEnough2 = self::GE|constructor#redirNotEnough2;
static redirecting-factory tearoff redirNotEnough2 = self::GE|constructor#_#redirNotEnough2#tearOff;
}
static inline-class-member method E|constructor#(core::int foo) → self::E /* = core::int */ {
lowered final self::E /* = core::int */ #this = foo;
return #this;
}
static inline-class-member method E|constructor#_#new#tearOff(core::int foo) → self::E /* = core::int */
return self::E|constructor#(foo);
static inline-class-member method E|constructor#redirNotEnough() → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:6:32: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function()'.
factory E.redirNotEnough() = E; // Error.
^";
static inline-class-member method E|constructor#_#redirNotEnough#tearOff() → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:6:32: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function()'.
factory E.redirNotEnough() = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany1(core::int foo, core::String bar = #C1) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:8:50: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String)'.
factory E.redirTooMany1(int foo, String bar) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany1#tearOff(core::int foo, core::String bar = #C1) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:8:50: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String)'.
factory E.redirTooMany1(int foo, String bar) = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany2(core::int foo, core::String bar = #C1, core::num baz = #C1) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:9:59: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String, num)'.
factory E.redirTooMany2(int foo, String bar, num baz) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany2#tearOff(core::int foo, core::String bar = #C1, core::num baz = #C1) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:9:59: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String, num)'.
factory E.redirTooMany2(int foo, String bar, num baz) = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany3(core::int foo, [dynamic bar = #C1]) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:10:53: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, [dynamic])'.
factory E.redirTooMany3(int foo, [dynamic bar]) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany3#tearOff(core::int foo, [dynamic bar = #C1]) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:10:53: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, [dynamic])'.
factory E.redirTooMany3(int foo, [dynamic bar]) = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany4(core::int foo, {required core::Object bar = #C1}) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:11:61: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, {Object bar})'.
- 'Object' is from 'dart:core'.
factory E.redirTooMany4(int foo, {required Object bar}) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany4#tearOff(core::int foo, {required core::Object bar = #C1}) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:11:61: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, {Object bar})'.
- 'Object' is from 'dart:core'.
factory E.redirTooMany4(int foo, {required Object bar}) = E; // Error.
^";
static inline-class-member method E|constructor#redirCyclic1(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:13:11: Error: Cyclic definition of factory 'E.redirCyclic1'.
factory E.redirCyclic1(int foo) = E.redirCyclic2; // Error.
^";
static inline-class-member method E|constructor#_#redirCyclic1#tearOff(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:13:11: Error: Cyclic definition of factory 'E.redirCyclic1'.
factory E.redirCyclic1(int foo) = E.redirCyclic2; // Error.
^";
static inline-class-member method E|constructor#redirCyclic2(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:14:11: Error: Cyclic definition of factory 'E.redirCyclic2'.
factory E.redirCyclic2(int foo) = E.redirCyclic1; // Error.
^";
static inline-class-member method E|constructor#_#redirCyclic2#tearOff(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:14:11: Error: Cyclic definition of factory 'E.redirCyclic2'.
factory E.redirCyclic2(int foo) = E.redirCyclic1; // Error.
^";
static inline-class-member method E|constructor#redirCyclicSelf(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:16:11: Error: Cyclic definition of factory 'E.redirCyclicSelf'.
factory E.redirCyclicSelf(int foo) = E.redirCyclicSelf; // Error.
^";
static inline-class-member method E|constructor#_#redirCyclicSelf#tearOff(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:16:11: Error: Cyclic definition of factory 'E.redirCyclicSelf'.
factory E.redirCyclicSelf(int foo) = E.redirCyclicSelf; // Error.
^";
static inline-class-member method GE|constructor#<X extends core::Object? = dynamic>(self::GE|constructor#::X% foo) → self::GE<self::GE|constructor#::X%> /* = self::GE|constructor#::X% */ {
lowered final self::GE<self::GE|constructor#::X%> /* = self::GE|constructor#::X% */ #this = foo;
return #this;
}
static inline-class-member method GE|constructor#_#new#tearOff<X extends core::Object? = dynamic>(self::GE|constructor#_#new#tearOff::X% foo) → self::GE<self::GE|constructor#_#new#tearOff::X%>% /* = self::GE|constructor#_#new#tearOff::X% */
return self::GE|constructor#<self::GE|constructor#_#new#tearOff::X%>(foo);
static inline-class-member method GE|constructor#redirNotEnough1<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#redirNotEnough1::X%> /* = self::GE|constructor#redirNotEnough1::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
static inline-class-member method GE|constructor#_#redirNotEnough1#tearOff<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#_#redirNotEnough1#tearOff::X%>% /* = self::GE|constructor#_#redirNotEnough1#tearOff::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
static inline-class-member method GE|constructor#redirNotEnough2<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#redirNotEnough2::X%> /* = self::GE|constructor#redirNotEnough2::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
static inline-class-member method GE|constructor#_#redirNotEnough2#tearOff<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#_#redirNotEnough2#tearOff::X%>% /* = self::GE|constructor#_#redirNotEnough2#tearOff::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
constants {
#C1 = null
}

View file

@ -0,0 +1,164 @@
library;
//
// Problems in library:
//
// pkg/front_end/testcases/extension_types/issue53209.dart:6:32: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function()'.
// factory E.redirNotEnough() = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:8:50: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String)'.
// factory E.redirTooMany1(int foo, String bar) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:9:59: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String, num)'.
// factory E.redirTooMany2(int foo, String bar, num baz) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:10:53: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, [dynamic])'.
// factory E.redirTooMany3(int foo, [dynamic bar]) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:11:61: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, {Object bar})'.
// - 'Object' is from 'dart:core'.
// factory E.redirTooMany4(int foo, {required Object bar}) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:13:11: Error: Cyclic definition of factory 'E.redirCyclic1'.
// factory E.redirCyclic1(int foo) = E.redirCyclic2; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:14:11: Error: Cyclic definition of factory 'E.redirCyclic2'.
// factory E.redirCyclic2(int foo) = E.redirCyclic1; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:16:11: Error: Cyclic definition of factory 'E.redirCyclicSelf'.
// factory E.redirCyclicSelf(int foo) = E.redirCyclicSelf; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
// factory GE.redirNotEnough1() = GE; // Error.
// ^
//
import self as self;
import "dart:core" as core;
extension type E(core::int foo) {
abstract inline-class-member representation-field get foo() → core::int;
constructor • = self::E|constructor#;
constructor tearoff • = self::E|constructor#_#new#tearOff;
static redirecting-factory redirNotEnough = self::E|constructor#redirNotEnough;
static redirecting-factory tearoff redirNotEnough = self::E|constructor#_#redirNotEnough#tearOff;
static redirecting-factory redirTooMany1 = self::E|constructor#redirTooMany1;
static redirecting-factory tearoff redirTooMany1 = self::E|constructor#_#redirTooMany1#tearOff;
static redirecting-factory redirTooMany2 = self::E|constructor#redirTooMany2;
static redirecting-factory tearoff redirTooMany2 = self::E|constructor#_#redirTooMany2#tearOff;
static redirecting-factory redirTooMany3 = self::E|constructor#redirTooMany3;
static redirecting-factory tearoff redirTooMany3 = self::E|constructor#_#redirTooMany3#tearOff;
static redirecting-factory redirTooMany4 = self::E|constructor#redirTooMany4;
static redirecting-factory tearoff redirTooMany4 = self::E|constructor#_#redirTooMany4#tearOff;
static redirecting-factory redirCyclic1 = self::E|constructor#redirCyclic1;
static redirecting-factory tearoff redirCyclic1 = self::E|constructor#_#redirCyclic1#tearOff;
static redirecting-factory redirCyclic2 = self::E|constructor#redirCyclic2;
static redirecting-factory tearoff redirCyclic2 = self::E|constructor#_#redirCyclic2#tearOff;
static redirecting-factory redirCyclicSelf = self::E|constructor#redirCyclicSelf;
static redirecting-factory tearoff redirCyclicSelf = self::E|constructor#_#redirCyclicSelf#tearOff;
}
extension type GE<X extends core::Object? = dynamic>(X% foo) {
abstract inline-class-member representation-field get foo() → X%;
constructor • = self::GE|constructor#;
constructor tearoff • = self::GE|constructor#_#new#tearOff;
static redirecting-factory redirNotEnough1 = self::GE|constructor#redirNotEnough1;
static redirecting-factory tearoff redirNotEnough1 = self::GE|constructor#_#redirNotEnough1#tearOff;
static redirecting-factory redirNotEnough2 = self::GE|constructor#redirNotEnough2;
static redirecting-factory tearoff redirNotEnough2 = self::GE|constructor#_#redirNotEnough2#tearOff;
}
static inline-class-member method E|constructor#(core::int foo) → self::E /* = core::int */
;
static inline-class-member method E|constructor#_#new#tearOff(core::int foo) → self::E /* = core::int */
return self::E|constructor#(foo);
static inline-class-member method E|constructor#redirNotEnough() → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:6:32: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function()'.
factory E.redirNotEnough() = E; // Error.
^";
static inline-class-member method E|constructor#_#redirNotEnough#tearOff() → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:6:32: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function()'.
factory E.redirNotEnough() = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany1(core::int foo, core::String bar) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:8:50: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String)'.
factory E.redirTooMany1(int foo, String bar) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany1#tearOff(core::int foo, core::String bar) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:8:50: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String)'.
factory E.redirTooMany1(int foo, String bar) = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany2(core::int foo, core::String bar, core::num baz) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:9:59: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String, num)'.
factory E.redirTooMany2(int foo, String bar, num baz) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany2#tearOff(core::int foo, core::String bar, core::num baz) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:9:59: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String, num)'.
factory E.redirTooMany2(int foo, String bar, num baz) = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany3(core::int foo, [dynamic bar]) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:10:53: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, [dynamic])'.
factory E.redirTooMany3(int foo, [dynamic bar]) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany3#tearOff(core::int foo, [dynamic bar]) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:10:53: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, [dynamic])'.
factory E.redirTooMany3(int foo, [dynamic bar]) = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany4(core::int foo, {required core::Object bar}) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:11:61: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, {Object bar})'.
- 'Object' is from 'dart:core'.
factory E.redirTooMany4(int foo, {required Object bar}) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany4#tearOff(core::int foo, {required core::Object bar}) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:11:61: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, {Object bar})'.
- 'Object' is from 'dart:core'.
factory E.redirTooMany4(int foo, {required Object bar}) = E; // Error.
^";
static inline-class-member method E|constructor#redirCyclic1(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:13:11: Error: Cyclic definition of factory 'E.redirCyclic1'.
factory E.redirCyclic1(int foo) = E.redirCyclic2; // Error.
^";
static inline-class-member method E|constructor#_#redirCyclic1#tearOff(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:13:11: Error: Cyclic definition of factory 'E.redirCyclic1'.
factory E.redirCyclic1(int foo) = E.redirCyclic2; // Error.
^";
static inline-class-member method E|constructor#redirCyclic2(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:14:11: Error: Cyclic definition of factory 'E.redirCyclic2'.
factory E.redirCyclic2(int foo) = E.redirCyclic1; // Error.
^";
static inline-class-member method E|constructor#_#redirCyclic2#tearOff(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:14:11: Error: Cyclic definition of factory 'E.redirCyclic2'.
factory E.redirCyclic2(int foo) = E.redirCyclic1; // Error.
^";
static inline-class-member method E|constructor#redirCyclicSelf(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:16:11: Error: Cyclic definition of factory 'E.redirCyclicSelf'.
factory E.redirCyclicSelf(int foo) = E.redirCyclicSelf; // Error.
^";
static inline-class-member method E|constructor#_#redirCyclicSelf#tearOff(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:16:11: Error: Cyclic definition of factory 'E.redirCyclicSelf'.
factory E.redirCyclicSelf(int foo) = E.redirCyclicSelf; // Error.
^";
static inline-class-member method GE|constructor#<X extends core::Object? = dynamic>(self::GE|constructor#::X% foo) → self::GE<self::GE|constructor#::X%> /* = self::GE|constructor#::X% */
;
static inline-class-member method GE|constructor#_#new#tearOff<X extends core::Object? = dynamic>(self::GE|constructor#_#new#tearOff::X% foo) → self::GE<self::GE|constructor#_#new#tearOff::X%>% /* = self::GE|constructor#_#new#tearOff::X% */
return self::GE|constructor#<self::GE|constructor#_#new#tearOff::X%>(foo);
static inline-class-member method GE|constructor#redirNotEnough1<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#redirNotEnough1::X%> /* = self::GE|constructor#redirNotEnough1::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
static inline-class-member method GE|constructor#_#redirNotEnough1#tearOff<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#_#redirNotEnough1#tearOff::X%>% /* = self::GE|constructor#_#redirNotEnough1#tearOff::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
static inline-class-member method GE|constructor#redirNotEnough2<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#redirNotEnough2::X%> /* = self::GE|constructor#redirNotEnough2::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
static inline-class-member method GE|constructor#_#redirNotEnough2#tearOff<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#_#redirNotEnough2#tearOff::X%>% /* = self::GE|constructor#_#redirNotEnough2#tearOff::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";

View file

@ -0,0 +1,172 @@
library;
//
// Problems in library:
//
// pkg/front_end/testcases/extension_types/issue53209.dart:6:32: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function()'.
// factory E.redirNotEnough() = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:8:50: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String)'.
// factory E.redirTooMany1(int foo, String bar) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:9:59: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String, num)'.
// factory E.redirTooMany2(int foo, String bar, num baz) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:10:53: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, [dynamic])'.
// factory E.redirTooMany3(int foo, [dynamic bar]) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:11:61: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, {Object bar})'.
// - 'Object' is from 'dart:core'.
// factory E.redirTooMany4(int foo, {required Object bar}) = E; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:13:11: Error: Cyclic definition of factory 'E.redirCyclic1'.
// factory E.redirCyclic1(int foo) = E.redirCyclic2; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:14:11: Error: Cyclic definition of factory 'E.redirCyclic2'.
// factory E.redirCyclic2(int foo) = E.redirCyclic1; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:16:11: Error: Cyclic definition of factory 'E.redirCyclicSelf'.
// factory E.redirCyclicSelf(int foo) = E.redirCyclicSelf; // Error.
// ^
//
// pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
// factory GE.redirNotEnough1() = GE; // Error.
// ^
//
import self as self;
import "dart:core" as core;
extension type E(core::int foo) {
abstract inline-class-member representation-field get foo() → core::int;
constructor • = self::E|constructor#;
constructor tearoff • = self::E|constructor#_#new#tearOff;
static redirecting-factory redirNotEnough = self::E|constructor#redirNotEnough;
static redirecting-factory tearoff redirNotEnough = self::E|constructor#_#redirNotEnough#tearOff;
static redirecting-factory redirTooMany1 = self::E|constructor#redirTooMany1;
static redirecting-factory tearoff redirTooMany1 = self::E|constructor#_#redirTooMany1#tearOff;
static redirecting-factory redirTooMany2 = self::E|constructor#redirTooMany2;
static redirecting-factory tearoff redirTooMany2 = self::E|constructor#_#redirTooMany2#tearOff;
static redirecting-factory redirTooMany3 = self::E|constructor#redirTooMany3;
static redirecting-factory tearoff redirTooMany3 = self::E|constructor#_#redirTooMany3#tearOff;
static redirecting-factory redirTooMany4 = self::E|constructor#redirTooMany4;
static redirecting-factory tearoff redirTooMany4 = self::E|constructor#_#redirTooMany4#tearOff;
static redirecting-factory redirCyclic1 = self::E|constructor#redirCyclic1;
static redirecting-factory tearoff redirCyclic1 = self::E|constructor#_#redirCyclic1#tearOff;
static redirecting-factory redirCyclic2 = self::E|constructor#redirCyclic2;
static redirecting-factory tearoff redirCyclic2 = self::E|constructor#_#redirCyclic2#tearOff;
static redirecting-factory redirCyclicSelf = self::E|constructor#redirCyclicSelf;
static redirecting-factory tearoff redirCyclicSelf = self::E|constructor#_#redirCyclicSelf#tearOff;
}
extension type GE<X extends core::Object? = dynamic>(X% foo) {
abstract inline-class-member representation-field get foo() → X%;
constructor • = self::GE|constructor#;
constructor tearoff • = self::GE|constructor#_#new#tearOff;
static redirecting-factory redirNotEnough1 = self::GE|constructor#redirNotEnough1;
static redirecting-factory tearoff redirNotEnough1 = self::GE|constructor#_#redirNotEnough1#tearOff;
static redirecting-factory redirNotEnough2 = self::GE|constructor#redirNotEnough2;
static redirecting-factory tearoff redirNotEnough2 = self::GE|constructor#_#redirNotEnough2#tearOff;
}
static inline-class-member method E|constructor#(core::int foo) → self::E /* = core::int */ {
lowered final self::E /* = core::int */ #this = foo;
return #this;
}
static inline-class-member method E|constructor#_#new#tearOff(core::int foo) → self::E /* = core::int */
return self::E|constructor#(foo);
static inline-class-member method E|constructor#redirNotEnough() → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:6:32: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function()'.
factory E.redirNotEnough() = E; // Error.
^";
static inline-class-member method E|constructor#_#redirNotEnough#tearOff() → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:6:32: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function()'.
factory E.redirNotEnough() = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany1(core::int foo, core::String bar = #C1) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:8:50: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String)'.
factory E.redirTooMany1(int foo, String bar) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany1#tearOff(core::int foo, core::String bar = #C1) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:8:50: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String)'.
factory E.redirTooMany1(int foo, String bar) = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany2(core::int foo, core::String bar = #C1, core::num baz = #C1) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:9:59: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String, num)'.
factory E.redirTooMany2(int foo, String bar, num baz) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany2#tearOff(core::int foo, core::String bar = #C1, core::num baz = #C1) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:9:59: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, String, num)'.
factory E.redirTooMany2(int foo, String bar, num baz) = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany3(core::int foo, [dynamic bar = #C1]) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:10:53: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, [dynamic])'.
factory E.redirTooMany3(int foo, [dynamic bar]) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany3#tearOff(core::int foo, [dynamic bar = #C1]) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:10:53: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, [dynamic])'.
factory E.redirTooMany3(int foo, [dynamic bar]) = E; // Error.
^";
static inline-class-member method E|constructor#redirTooMany4(core::int foo, {required core::Object bar = #C1}) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:11:61: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, {Object bar})'.
- 'Object' is from 'dart:core'.
factory E.redirTooMany4(int foo, {required Object bar}) = E; // Error.
^";
static inline-class-member method E|constructor#_#redirTooMany4#tearOff(core::int foo, {required core::Object bar = #C1}) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:11:61: Error: The constructor function type 'E Function(int)' isn't a subtype of 'E Function(int, {Object bar})'.
- 'Object' is from 'dart:core'.
factory E.redirTooMany4(int foo, {required Object bar}) = E; // Error.
^";
static inline-class-member method E|constructor#redirCyclic1(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:13:11: Error: Cyclic definition of factory 'E.redirCyclic1'.
factory E.redirCyclic1(int foo) = E.redirCyclic2; // Error.
^";
static inline-class-member method E|constructor#_#redirCyclic1#tearOff(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:13:11: Error: Cyclic definition of factory 'E.redirCyclic1'.
factory E.redirCyclic1(int foo) = E.redirCyclic2; // Error.
^";
static inline-class-member method E|constructor#redirCyclic2(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:14:11: Error: Cyclic definition of factory 'E.redirCyclic2'.
factory E.redirCyclic2(int foo) = E.redirCyclic1; // Error.
^";
static inline-class-member method E|constructor#_#redirCyclic2#tearOff(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:14:11: Error: Cyclic definition of factory 'E.redirCyclic2'.
factory E.redirCyclic2(int foo) = E.redirCyclic1; // Error.
^";
static inline-class-member method E|constructor#redirCyclicSelf(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:16:11: Error: Cyclic definition of factory 'E.redirCyclicSelf'.
factory E.redirCyclicSelf(int foo) = E.redirCyclicSelf; // Error.
^";
static inline-class-member method E|constructor#_#redirCyclicSelf#tearOff(core::int foo) → self::E /* = core::int */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:16:11: Error: Cyclic definition of factory 'E.redirCyclicSelf'.
factory E.redirCyclicSelf(int foo) = E.redirCyclicSelf; // Error.
^";
static inline-class-member method GE|constructor#<X extends core::Object? = dynamic>(self::GE|constructor#::X% foo) → self::GE<self::GE|constructor#::X%> /* = self::GE|constructor#::X% */ {
lowered final self::GE<self::GE|constructor#::X%> /* = self::GE|constructor#::X% */ #this = foo;
return #this;
}
static inline-class-member method GE|constructor#_#new#tearOff<X extends core::Object? = dynamic>(self::GE|constructor#_#new#tearOff::X% foo) → self::GE<self::GE|constructor#_#new#tearOff::X%>% /* = self::GE|constructor#_#new#tearOff::X% */
return self::GE|constructor#<self::GE|constructor#_#new#tearOff::X%>(foo);
static inline-class-member method GE|constructor#redirNotEnough1<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#redirNotEnough1::X%> /* = self::GE|constructor#redirNotEnough1::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
static inline-class-member method GE|constructor#_#redirNotEnough1#tearOff<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#_#redirNotEnough1#tearOff::X%>% /* = self::GE|constructor#_#redirNotEnough1#tearOff::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
static inline-class-member method GE|constructor#redirNotEnough2<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#redirNotEnough2::X%> /* = self::GE|constructor#redirNotEnough2::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
static inline-class-member method GE|constructor#_#redirNotEnough2#tearOff<X extends core::Object? = dynamic>() → self::GE<self::GE|constructor#_#redirNotEnough2#tearOff::X%>% /* = self::GE|constructor#_#redirNotEnough2#tearOff::X% */
return invalid-expression "pkg/front_end/testcases/extension_types/issue53209.dart:20:34: Error: The constructor function type 'GE<dynamic> Function(dynamic)' isn't a subtype of 'GE<X> Function()'.
factory GE.redirNotEnough1() = GE; // Error.
^";
constants {
#C1 = null
}