[cfe] Ensure default value on super parameter tear-off

Closes #52763

Change-Id: I765c80d9889315a32832e0f881dba1fc41400fad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313124
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
Johnni Winther 2023-07-13 08:05:50 +00:00 committed by Commit Queue
parent 150587d2b5
commit 6d56a75dca
43 changed files with 1880 additions and 66 deletions

View file

@ -97,14 +97,21 @@ class FormalParameterBuilder extends ModifierBuilderImpl
bool initializerWasInferred = false;
/// True if the initializer was declared by the programmer.
bool hasDeclaredInitializer = false;
final bool hasImmediatelyDeclaredInitializer;
/// True if the initializer was declared by the programmer, either directly
/// or inferred from a super parameter.
bool hasDeclaredInitializer;
final bool isExtensionThis;
FormalParameterBuilder(this.metadata, this.kind, this.modifiers, this.type,
this.name, LibraryBuilder? compilationUnit, int charOffset,
{Uri? fileUri, this.isExtensionThis = false})
{Uri? fileUri,
this.isExtensionThis = false,
required this.hasImmediatelyDeclaredInitializer})
: this.fileUri = fileUri ?? compilationUnit?.fileUri,
this.hasDeclaredInitializer = hasImmediatelyDeclaredInitializer,
super(compilationUnit, charOffset) {
type.registerInferredTypeListener(this);
}
@ -203,7 +210,8 @@ class FormalParameterBuilder extends ModifierBuilderImpl
null,
charOffset,
fileUri: fileUri,
isExtensionThis: isExtensionThis)
isExtensionThis: isExtensionThis,
hasImmediatelyDeclaredInitializer: hasImmediatelyDeclaredInitializer)
..parent = parent
..variable = variable;
} else if (isSuperInitializingFormal) {
@ -216,7 +224,8 @@ class FormalParameterBuilder extends ModifierBuilderImpl
null,
charOffset,
fileUri: fileUri,
isExtensionThis: isExtensionThis)
isExtensionThis: isExtensionThis,
hasImmediatelyDeclaredInitializer: hasImmediatelyDeclaredInitializer)
..parent = parent
..variable = variable;
} else {
@ -278,7 +287,8 @@ class FormalParameterBuilder extends ModifierBuilderImpl
bodyBuilder.performBacklogComputations(
delayedActionPerformers: delayedActionPerformers,
allowFurtherDelays: false);
} else if (kind != FormalParameterKind.requiredPositional) {
} else if (kind != FormalParameterKind.requiredPositional &&
!isSuperInitializingFormal) {
// As done by BodyBuilder.endFormalParameter.
variable!.initializer = new NullLiteral()..parent = variable;
}

View file

@ -1210,26 +1210,32 @@ class BodyBuilder extends StackListenerImpl
for (int i = 0; i < formals.parameters!.length; i++) {
FormalParameterBuilder parameter = formals.parameters![i];
Expression? initializer = parameter.variable!.initializer;
if (!parameter.isSuperInitializingFormal &&
(parameter.isOptionalPositional || initializer != null)) {
bool inferInitializer;
if (parameter.isSuperInitializingFormal) {
// Super-parameters can inherit the default value from the super
// constructor so we only handle explicit default values here.
inferInitializer = parameter.hasImmediatelyDeclaredInitializer;
} else if (initializer != null) {
inferInitializer = true;
} else {
inferInitializer = parameter.isOptional;
}
if (inferInitializer) {
if (!parameter.initializerWasInferred) {
parameter.initializerWasInferred = true;
if (parameter.isOptionalPositional) {
initializer ??= forest.createNullLiteral(
// TODO(ahe): Should store: originParameter.fileOffset
// https://github.com/dart-lang/sdk/issues/32289
noLocation);
}
initializer ??= forest.createNullLiteral(
// TODO(ahe): Should store: originParameter.fileOffset
// https://github.com/dart-lang/sdk/issues/32289
noLocation);
VariableDeclaration originParameter =
_context.getFormalParameter(i);
initializer = typeInferrer.inferParameterInitializer(
this,
initializer!,
initializer,
originParameter.type,
parameter.hasDeclaredInitializer);
originParameter.initializer = initializer..parent = originParameter;
parameter.initializerWasInferred = true;
}
VariableDeclaration? tearOffParameter =
_context.getTearOffParameter(i);
if (tearOffParameter != null) {
@ -1744,7 +1750,8 @@ class BodyBuilder extends StackListenerImpl
formal.name!,
libraryBuilder,
formal.fileOffset,
fileUri: uri)
fileUri: uri,
hasImmediatelyDeclaredInitializer: false)
..variable = formal;
}, growable: false);
enterLocalScope(new FormalParameters(formals, fileOffset, noLength, uri)
@ -5348,8 +5355,8 @@ class BodyBuilder extends StackListenerImpl
name?.name ?? '',
libraryBuilder,
offsetForToken(nameToken),
fileUri: uri)
..hasDeclaredInitializer = (initializerStart != null);
fileUri: uri,
hasImmediatelyDeclaredInitializer: initializerStart != null);
}
VariableDeclaration variable = parameter.build(libraryBuilder);
Expression? initializer = name?.initializer;

View file

@ -246,7 +246,7 @@ final TypeBuilder dummyTypeBuilder =
final FormalParameterBuilder dummyFormalParameterBuilder =
new FormalParameterBuilder(null, FormalParameterKind.requiredPositional, 0,
const ImplicitTypeBuilder(), '', null, -1,
fileUri: dummyUri);
fileUri: dummyUri, hasImmediatelyDeclaredInitializer: false);
final TypeVariableBuilder dummyTypeVariableBuilder = new TypeVariableBuilder(
TypeVariableBuilder.noNameSentinel, null, -1, null,
kind: TypeVariableKind.function);

View file

@ -2102,7 +2102,8 @@ class OutlineBuilder extends StackListenerImpl {
null,
charOffset,
fileUri: uri,
isExtensionThis: true));
isExtensionThis: true,
hasImmediatelyDeclaredInitializer: false));
if (formals != null) {
synthesizedFormals.addAll(formals);
}

View file

@ -655,7 +655,8 @@ class DeclaredSourceConstructorBuilder
FormalParameterBuilder formal = formals![formalIndex];
if (formal.isSuperInitializingFormal) {
superInitializingFormalIndex++;
bool hasImmediatelyDeclaredInitializer = formal.hasDeclaredInitializer;
bool hasImmediatelyDeclaredInitializer =
formal.hasImmediatelyDeclaredInitializer;
DartType? correspondingSuperFormalType;
if (formal.isPositional) {
@ -718,6 +719,15 @@ class DeclaredSourceConstructorBuilder
namedSuperParameters: namedSuperParameters ?? const <String>[],
isOutlineNode: true,
libraryBuilder: libraryBuilder));
if (_constructorTearOff != null) {
delayedDefaultValueCloners.add(new DelayedDefaultValueCloner(
superTarget, _constructorTearOff!, substitution,
positionalSuperParameters:
positionalSuperParameters ?? const <int>[],
namedSuperParameters: namedSuperParameters ?? const <String>[],
isOutlineNode: true,
libraryBuilder: libraryBuilder));
}
_hasDefaultValueCloner = true;
}
}

View file

@ -319,7 +319,8 @@ class SourceEnumBuilder extends SourceClassBuilder {
intType,
"#index",
libraryBuilder,
charOffset),
charOffset,
hasImmediatelyDeclaredInitializer: false),
new FormalParameterBuilder(
null,
FormalParameterKind.requiredPositional,
@ -327,7 +328,8 @@ class SourceEnumBuilder extends SourceClassBuilder {
stringType,
"#name",
libraryBuilder,
charOffset)
charOffset,
hasImmediatelyDeclaredInitializer: false)
],
libraryBuilder,
charOffset,
@ -361,7 +363,8 @@ class SourceEnumBuilder extends SourceClassBuilder {
stringType,
"#name",
libraryBuilder,
charOffset));
charOffset,
hasImmediatelyDeclaredInitializer: false));
member.formals!.insert(
0,
new FormalParameterBuilder(
@ -371,7 +374,8 @@ class SourceEnumBuilder extends SourceClassBuilder {
intType,
"#index",
libraryBuilder,
charOffset));
charOffset,
hasImmediatelyDeclaredInitializer: false));
}
}
}

View file

@ -3310,9 +3310,9 @@ class SourceLibraryBuilder extends LibraryBuilderImpl {
}
FormalParameterBuilder formal = new FormalParameterBuilder(
metadata, kind, modifiers, type, name, this, charOffset,
fileUri: fileUri)
..initializerToken = initializerToken
..hasDeclaredInitializer = (initializerToken != null);
fileUri: fileUri,
hasImmediatelyDeclaredInitializer: initializerToken != null)
..initializerToken = initializerToken;
return formal;
}

View file

@ -52,6 +52,7 @@ augmented
auth
authority
autobianchi
autofocus
automatic
averaged
averages

View file

@ -0,0 +1,49 @@
// 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.
abstract class B {
final bool autofocus;
const B({required this.autofocus});
}
class O1 extends B {
const O1({bool autofocus = true}) : super(autofocus: autofocus);
}
class O2 extends B {
const O2({super.autofocus = true});
}
abstract class C {
final bool a;
final bool b;
const C({this.a = true, this.b = false});
}
class P1 extends C {
final int c;
const P1(this.c, {super.a, super.b});
}
class P2 extends C {
const P2({super.b, super.a});
}
main() {
var tearoff1 = O1.new;
var tearoff2 = O2.new;
var tearoff3 = P1.new;
var tearoff4 = P2.new;
expect(true, tearoff1().autofocus);
expect(true, tearoff2().autofocus);
expect(true, tearoff3(0).a);
expect(false, tearoff3(0).b);
expect(0, tearoff3(0).c);
expect(true, tearoff4().a);
expect(false, tearoff4().b);
}
expect(expected, actual) {
if (expected != actual) throw 'Expected $expected, actual $actual';
}

View file

@ -0,0 +1,73 @@
library;
import self as self;
import "dart:core" as core;
abstract class B extends core::Object /*hasConstConstructor*/ {
final field core::bool autofocus;
const constructor •({required core::bool autofocus = #C1}) → self::B
: self::B::autofocus = autofocus, super core::Object::•()
;
}
class O1 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = #C2}) → self::O1
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({core::bool autofocus = #C2}) → self::O1
return new self::O1::•(autofocus: autofocus);
}
class O2 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = #C2}) → self::O2
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({core::bool autofocus = #C2}) → self::O2
return new self::O2::•(autofocus: autofocus);
}
abstract class C extends core::Object /*hasConstConstructor*/ {
final field core::bool a;
final field core::bool b;
const constructor •({core::bool a = #C2, core::bool b = #C3}) → self::C
: self::C::a = a, self::C::b = b, super core::Object::•()
;
}
class P1 extends self::C /*hasConstConstructor*/ {
final field core::int c;
const constructor •(core::int c, {core::bool a = #C2, core::bool b = #C3}) → self::P1
: self::P1::c = c, super self::C::•(a: a, b: b)
;
static method _#new#tearOff(core::int c, {core::bool a = #C2, core::bool b = #C3}) → self::P1
return new self::P1::•(c, a: a, b: b);
}
class P2 extends self::C /*hasConstConstructor*/ {
const constructor •({core::bool b = #C3, core::bool a = #C2}) → self::P2
: super self::C::•(b: b, a: a)
;
static method _#new#tearOff({core::bool b = #C3, core::bool a = #C2}) → self::P2
return new self::P2::•(b: b, a: a);
}
static method main() → dynamic {
({autofocus: core::bool}) → self::O1 tearoff1 = #C4;
({autofocus: core::bool}) → self::O2 tearoff2 = #C5;
(core::int, {a: core::bool, b: core::bool}) → self::P1 tearoff3 = #C6;
({a: core::bool, b: core::bool}) → self::P2 tearoff4 = #C7;
self::expect(true, tearoff1(){({autofocus: core::bool}) → self::O1}.{self::B::autofocus}{core::bool});
self::expect(true, tearoff2(){({autofocus: core::bool}) → self::O2}.{self::B::autofocus}{core::bool});
self::expect(true, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::C::a}{core::bool});
self::expect(false, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::C::b}{core::bool});
self::expect(0, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::P1::c}{core::int});
self::expect(true, tearoff4(){({a: core::bool, b: core::bool}) → self::P2}.{self::C::a}{core::bool});
self::expect(false, tearoff4(){({a: core::bool, b: core::bool}) → self::P2}.{self::C::b}{core::bool});
}
static method expect(dynamic expected, dynamic actual) → dynamic {
if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual))
throw "Expected ${expected}, actual ${actual}";
}
constants {
#C1 = null
#C2 = true
#C3 = false
#C4 = static-tearoff self::O1::_#new#tearOff
#C5 = static-tearoff self::O2::_#new#tearOff
#C6 = static-tearoff self::P1::_#new#tearOff
#C7 = static-tearoff self::P2::_#new#tearOff
}

View file

@ -0,0 +1,73 @@
library;
import self as self;
import "dart:core" as core;
abstract class B extends core::Object /*hasConstConstructor*/ {
final field core::bool autofocus;
const constructor •({required core::bool autofocus = #C1}) → self::B
: self::B::autofocus = autofocus, super core::Object::•()
;
}
class O1 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = #C2}) → self::O1
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({core::bool autofocus = #C2}) → self::O1
return new self::O1::•(autofocus: autofocus);
}
class O2 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = #C2}) → self::O2
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({core::bool autofocus = #C2}) → self::O2
return new self::O2::•(autofocus: autofocus);
}
abstract class C extends core::Object /*hasConstConstructor*/ {
final field core::bool a;
final field core::bool b;
const constructor •({core::bool a = #C2, core::bool b = #C3}) → self::C
: self::C::a = a, self::C::b = b, super core::Object::•()
;
}
class P1 extends self::C /*hasConstConstructor*/ {
final field core::int c;
const constructor •(core::int c, {core::bool a = #C2, core::bool b = #C3}) → self::P1
: self::P1::c = c, super self::C::•(a: a, b: b)
;
static method _#new#tearOff(core::int c, {core::bool a = #C2, core::bool b = #C3}) → self::P1
return new self::P1::•(c, a: a, b: b);
}
class P2 extends self::C /*hasConstConstructor*/ {
const constructor •({core::bool b = #C3, core::bool a = #C2}) → self::P2
: super self::C::•(b: b, a: a)
;
static method _#new#tearOff({core::bool b = #C3, core::bool a = #C2}) → self::P2
return new self::P2::•(b: b, a: a);
}
static method main() → dynamic {
({autofocus: core::bool}) → self::O1 tearoff1 = #C4;
({autofocus: core::bool}) → self::O2 tearoff2 = #C5;
(core::int, {a: core::bool, b: core::bool}) → self::P1 tearoff3 = #C6;
({a: core::bool, b: core::bool}) → self::P2 tearoff4 = #C7;
self::expect(true, tearoff1(){({autofocus: core::bool}) → self::O1}.{self::B::autofocus}{core::bool});
self::expect(true, tearoff2(){({autofocus: core::bool}) → self::O2}.{self::B::autofocus}{core::bool});
self::expect(true, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::C::a}{core::bool});
self::expect(false, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::C::b}{core::bool});
self::expect(0, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::P1::c}{core::int});
self::expect(true, tearoff4(){({a: core::bool, b: core::bool}) → self::P2}.{self::C::a}{core::bool});
self::expect(false, tearoff4(){({a: core::bool, b: core::bool}) → self::P2}.{self::C::b}{core::bool});
}
static method expect(dynamic expected, dynamic actual) → dynamic {
if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual))
throw "Expected ${expected}, actual ${actual}";
}
constants {
#C1 = null
#C2 = true
#C3 = false
#C4 = static-tearoff self::O1::_#new#tearOff
#C5 = static-tearoff self::O2::_#new#tearOff
#C6 = static-tearoff self::P1::_#new#tearOff
#C7 = static-tearoff self::P2::_#new#tearOff
}

View file

@ -0,0 +1,30 @@
abstract class B {
final bool autofocus;
const B({required this.autofocus});
}
class O1 extends B {
const O1({bool autofocus = true}) : super(autofocus: autofocus);
}
class O2 extends B {
const O2({super.autofocus = true});
}
abstract class C {
final bool a;
final bool b;
const C({this.a = true, this.b = false});
}
class P1 extends C {
final int c;
const P1(this.c, {super.a, super.b});
}
class P2 extends C {
const P2({super.b, super.a});
}
main() {}
expect(expected, actual) {}

View file

@ -0,0 +1,30 @@
abstract class B {
const B({required this.autofocus});
final bool autofocus;
}
abstract class C {
const C({this.a = true, this.b = false});
final bool a;
final bool b;
}
class O1 extends B {
const O1({bool autofocus = true}) : super(autofocus: autofocus);
}
class O2 extends B {
const O2({super.autofocus = true});
}
class P1 extends C {
const P1(this.c, {super.a, super.b});
final int c;
}
class P2 extends C {
const P2({super.b, super.a});
}
expect(expected, actual) {}
main() {}

View file

@ -0,0 +1,73 @@
library;
import self as self;
import "dart:core" as core;
abstract class B extends core::Object /*hasConstConstructor*/ {
final field core::bool autofocus;
const constructor •({required core::bool autofocus = #C1}) → self::B
: self::B::autofocus = autofocus, super core::Object::•()
;
}
class O1 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = #C2}) → self::O1
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({core::bool autofocus = #C2}) → self::O1
return new self::O1::•(autofocus: autofocus);
}
class O2 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = #C2}) → self::O2
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({core::bool autofocus = #C2}) → self::O2
return new self::O2::•(autofocus: autofocus);
}
abstract class C extends core::Object /*hasConstConstructor*/ {
final field core::bool a;
final field core::bool b;
const constructor •({core::bool a = #C2, core::bool b = #C3}) → self::C
: self::C::a = a, self::C::b = b, super core::Object::•()
;
}
class P1 extends self::C /*hasConstConstructor*/ {
final field core::int c;
const constructor •(core::int c, {core::bool a = #C2, core::bool b = #C3}) → self::P1
: self::P1::c = c, super self::C::•(a: a, b: b)
;
static method _#new#tearOff(core::int c, {core::bool a = #C2, core::bool b = #C3}) → self::P1
return new self::P1::•(c, a: a, b: b);
}
class P2 extends self::C /*hasConstConstructor*/ {
const constructor •({core::bool b = #C3, core::bool a = #C2}) → self::P2
: super self::C::•(b: b, a: a)
;
static method _#new#tearOff({core::bool b = #C3, core::bool a = #C2}) → self::P2
return new self::P2::•(b: b, a: a);
}
static method main() → dynamic {
({autofocus: core::bool}) → self::O1 tearoff1 = #C4;
({autofocus: core::bool}) → self::O2 tearoff2 = #C5;
(core::int, {a: core::bool, b: core::bool}) → self::P1 tearoff3 = #C6;
({a: core::bool, b: core::bool}) → self::P2 tearoff4 = #C7;
self::expect(true, tearoff1(){({autofocus: core::bool}) → self::O1}.{self::B::autofocus}{core::bool});
self::expect(true, tearoff2(){({autofocus: core::bool}) → self::O2}.{self::B::autofocus}{core::bool});
self::expect(true, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::C::a}{core::bool});
self::expect(false, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::C::b}{core::bool});
self::expect(0, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::P1::c}{core::int});
self::expect(true, tearoff4(){({a: core::bool, b: core::bool}) → self::P2}.{self::C::a}{core::bool});
self::expect(false, tearoff4(){({a: core::bool, b: core::bool}) → self::P2}.{self::C::b}{core::bool});
}
static method expect(dynamic expected, dynamic actual) → dynamic {
if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual))
throw "Expected ${expected}, actual ${actual}";
}
constants {
#C1 = null
#C2 = true
#C3 = false
#C4 = static-tearoff self::O1::_#new#tearOff
#C5 = static-tearoff self::O2::_#new#tearOff
#C6 = static-tearoff self::P1::_#new#tearOff
#C7 = static-tearoff self::P2::_#new#tearOff
}

View file

@ -0,0 +1,73 @@
library;
import self as self;
import "dart:core" as core;
abstract class B extends core::Object /*hasConstConstructor*/ {
final field core::bool autofocus;
const constructor •({required core::bool autofocus = #C1}) → self::B
: self::B::autofocus = autofocus, super core::Object::•()
;
}
class O1 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = #C2}) → self::O1
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({core::bool autofocus = #C2}) → self::O1
return new self::O1::•(autofocus: autofocus);
}
class O2 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = #C2}) → self::O2
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({core::bool autofocus = #C2}) → self::O2
return new self::O2::•(autofocus: autofocus);
}
abstract class C extends core::Object /*hasConstConstructor*/ {
final field core::bool a;
final field core::bool b;
const constructor •({core::bool a = #C2, core::bool b = #C3}) → self::C
: self::C::a = a, self::C::b = b, super core::Object::•()
;
}
class P1 extends self::C /*hasConstConstructor*/ {
final field core::int c;
const constructor •(core::int c, {core::bool a = #C2, core::bool b = #C3}) → self::P1
: self::P1::c = c, super self::C::•(a: a, b: b)
;
static method _#new#tearOff(core::int c, {core::bool a = #C2, core::bool b = #C3}) → self::P1
return new self::P1::•(c, a: a, b: b);
}
class P2 extends self::C /*hasConstConstructor*/ {
const constructor •({core::bool b = #C3, core::bool a = #C2}) → self::P2
: super self::C::•(b: b, a: a)
;
static method _#new#tearOff({core::bool b = #C3, core::bool a = #C2}) → self::P2
return new self::P2::•(b: b, a: a);
}
static method main() → dynamic {
({autofocus: core::bool}) → self::O1 tearoff1 = #C4;
({autofocus: core::bool}) → self::O2 tearoff2 = #C5;
(core::int, {a: core::bool, b: core::bool}) → self::P1 tearoff3 = #C6;
({a: core::bool, b: core::bool}) → self::P2 tearoff4 = #C7;
self::expect(true, tearoff1(){({autofocus: core::bool}) → self::O1}.{self::B::autofocus}{core::bool});
self::expect(true, tearoff2(){({autofocus: core::bool}) → self::O2}.{self::B::autofocus}{core::bool});
self::expect(true, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::C::a}{core::bool});
self::expect(false, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::C::b}{core::bool});
self::expect(0, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::P1::c}{core::int});
self::expect(true, tearoff4(){({a: core::bool, b: core::bool}) → self::P2}.{self::C::a}{core::bool});
self::expect(false, tearoff4(){({a: core::bool, b: core::bool}) → self::P2}.{self::C::b}{core::bool});
}
static method expect(dynamic expected, dynamic actual) → dynamic {
if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual))
throw "Expected ${expected}, actual ${actual}";
}
constants {
#C1 = null
#C2 = true
#C3 = false
#C4 = static-tearoff self::O1::_#new#tearOff
#C5 = static-tearoff self::O2::_#new#tearOff
#C6 = static-tearoff self::P1::_#new#tearOff
#C7 = static-tearoff self::P2::_#new#tearOff
}

View file

@ -0,0 +1,50 @@
library;
import self as self;
import "dart:core" as core;
abstract class B extends core::Object /*hasConstConstructor*/ {
final field core::bool autofocus;
const constructor •({required core::bool autofocus = null}) → self::B
: self::B::autofocus = autofocus, super core::Object::•()
;
}
class O1 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = true}) → self::O1
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({has-declared-initializer core::bool autofocus}) → self::O1
return new self::O1::•(autofocus: autofocus);
}
class O2 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = true}) → self::O2
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({has-declared-initializer core::bool autofocus}) → self::O2
return new self::O2::•(autofocus: autofocus);
}
abstract class C extends core::Object /*hasConstConstructor*/ {
final field core::bool a;
final field core::bool b;
const constructor •({core::bool a = true, core::bool b = false}) → self::C
: self::C::a = a, self::C::b = b, super core::Object::•()
;
}
class P1 extends self::C /*hasConstConstructor*/ {
final field core::int c;
const constructor •(core::int c, {core::bool a = true, core::bool b = false}) → self::P1
: self::P1::c = c, super self::C::•(a: a, b: b)
;
static method _#new#tearOff(core::int c, {core::bool a = true, core::bool b = false}) → self::P1
return new self::P1::•(c, a: a, b: b);
}
class P2 extends self::C /*hasConstConstructor*/ {
const constructor •({core::bool b = false, core::bool a = true}) → self::P2
: super self::C::•(b: b, a: a)
;
static method _#new#tearOff({core::bool b = false, core::bool a = true}) → self::P2
return new self::P2::•(b: b, a: a);
}
static method main() → dynamic
;
static method expect(dynamic expected, dynamic actual) → dynamic
;

View file

@ -0,0 +1,73 @@
library;
import self as self;
import "dart:core" as core;
abstract class B extends core::Object /*hasConstConstructor*/ {
final field core::bool autofocus;
const constructor •({required core::bool autofocus = #C1}) → self::B
: self::B::autofocus = autofocus, super core::Object::•()
;
}
class O1 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = #C2}) → self::O1
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({core::bool autofocus = #C2}) → self::O1
return new self::O1::•(autofocus: autofocus);
}
class O2 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = #C2}) → self::O2
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({core::bool autofocus = #C2}) → self::O2
return new self::O2::•(autofocus: autofocus);
}
abstract class C extends core::Object /*hasConstConstructor*/ {
final field core::bool a;
final field core::bool b;
const constructor •({core::bool a = #C2, core::bool b = #C3}) → self::C
: self::C::a = a, self::C::b = b, super core::Object::•()
;
}
class P1 extends self::C /*hasConstConstructor*/ {
final field core::int c;
const constructor •(core::int c, {core::bool a = #C2, core::bool b = #C3}) → self::P1
: self::P1::c = c, super self::C::•(a: a, b: b)
;
static method _#new#tearOff(core::int c, {core::bool a = #C2, core::bool b = #C3}) → self::P1
return new self::P1::•(c, a: a, b: b);
}
class P2 extends self::C /*hasConstConstructor*/ {
const constructor •({core::bool b = #C3, core::bool a = #C2}) → self::P2
: super self::C::•(b: b, a: a)
;
static method _#new#tearOff({core::bool b = #C3, core::bool a = #C2}) → self::P2
return new self::P2::•(b: b, a: a);
}
static method main() → dynamic {
({autofocus: core::bool}) → self::O1 tearoff1 = #C4;
({autofocus: core::bool}) → self::O2 tearoff2 = #C5;
(core::int, {a: core::bool, b: core::bool}) → self::P1 tearoff3 = #C6;
({a: core::bool, b: core::bool}) → self::P2 tearoff4 = #C7;
self::expect(true, tearoff1(){({autofocus: core::bool}) → self::O1}.{self::B::autofocus}{core::bool});
self::expect(true, tearoff2(){({autofocus: core::bool}) → self::O2}.{self::B::autofocus}{core::bool});
self::expect(true, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::C::a}{core::bool});
self::expect(false, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::C::b}{core::bool});
self::expect(0, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::P1::c}{core::int});
self::expect(true, tearoff4(){({a: core::bool, b: core::bool}) → self::P2}.{self::C::a}{core::bool});
self::expect(false, tearoff4(){({a: core::bool, b: core::bool}) → self::P2}.{self::C::b}{core::bool});
}
static method expect(dynamic expected, dynamic actual) → dynamic {
if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual))
throw "Expected ${expected}, actual ${actual}";
}
constants {
#C1 = null
#C2 = true
#C3 = false
#C4 = static-tearoff self::O1::_#new#tearOff
#C5 = static-tearoff self::O2::_#new#tearOff
#C6 = static-tearoff self::P1::_#new#tearOff
#C7 = static-tearoff self::P2::_#new#tearOff
}

View file

@ -0,0 +1,49 @@
// 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.
abstract class B {
final bool autofocus;
const B({required this.autofocus});
}
class O1 extends B {
const O1({bool autofocus = true}) : super(autofocus: autofocus);
}
class O2 extends B {
const O2({super.autofocus = true});
}
abstract class C {
final bool a;
final bool b;
const C({this.a = true, this.b = false});
}
class P1 extends C {
final int c;
const P1(this.c, {super.a, super.b});
}
class P2 extends C {
const P2({super.b, super.a});
}
main() {
var tearoff1 = O1.new;
var tearoff2 = O2.new;
var tearoff3 = P1.new;
var tearoff4 = P2.new;
expect(true, tearoff1().autofocus);
expect(true, tearoff2().autofocus);
expect(true, tearoff3(0).a);
expect(false, tearoff3(0).b);
expect(0, tearoff3(0).c);
expect(true, tearoff4().a);
expect(false, tearoff4().b);
}
expect(expected, actual) {
if (expected != actual) throw 'Expected $expected, actual $actual';
}

View file

@ -0,0 +1,73 @@
library;
import self as self;
import "dart:core" as core;
abstract class B extends core::Object /*hasConstConstructor*/ {
final field core::bool autofocus;
const constructor •({required core::bool autofocus = #C1}) → self::B
: self::B::autofocus = autofocus, super core::Object::•()
;
}
class O1 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = #C2}) → self::O1
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({core::bool autofocus = #C2}) → self::O1
return new self::O1::•(autofocus: autofocus);
}
class O2 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = #C2}) → self::O2
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({core::bool autofocus = #C2}) → self::O2
return new self::O2::•(autofocus: autofocus);
}
abstract class C extends core::Object /*hasConstConstructor*/ {
final field core::bool a;
final field core::bool b;
const constructor •({core::bool a = #C2, core::bool b = #C3}) → self::C
: self::C::a = a, self::C::b = b, super core::Object::•()
;
}
class P1 extends self::C /*hasConstConstructor*/ {
final field core::int c;
const constructor •(core::int c, {core::bool a = #C2, core::bool b = #C3}) → self::P1
: self::P1::c = c, super self::C::•(a: a, b: b)
;
static method _#new#tearOff(core::int c, {core::bool a = #C2, core::bool b = #C3}) → self::P1
return new self::P1::•(c, a: a, b: b);
}
class P2 extends self::C /*hasConstConstructor*/ {
const constructor •({core::bool b = #C3, core::bool a = #C2}) → self::P2
: super self::C::•(b: b, a: a)
;
static method _#new#tearOff({core::bool b = #C3, core::bool a = #C2}) → self::P2
return new self::P2::•(b: b, a: a);
}
static method main() → dynamic {
({autofocus: core::bool}) → self::O1 tearoff1 = #C4;
({autofocus: core::bool}) → self::O2 tearoff2 = #C5;
(core::int, {a: core::bool, b: core::bool}) → self::P1 tearoff3 = #C6;
({a: core::bool, b: core::bool}) → self::P2 tearoff4 = #C7;
self::expect(true, tearoff1(){({autofocus: core::bool}) → self::O1}.{self::B::autofocus}{core::bool});
self::expect(true, tearoff2(){({autofocus: core::bool}) → self::O2}.{self::B::autofocus}{core::bool});
self::expect(true, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::C::a}{core::bool});
self::expect(false, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::C::b}{core::bool});
self::expect(0, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::P1::c}{core::int});
self::expect(true, tearoff4(){({a: core::bool, b: core::bool}) → self::P2}.{self::C::a}{core::bool});
self::expect(false, tearoff4(){({a: core::bool, b: core::bool}) → self::P2}.{self::C::b}{core::bool});
}
static method expect(dynamic expected, dynamic actual) → dynamic {
if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual))
throw "Expected ${expected}, actual ${actual}";
}
constants {
#C1 = null
#C2 = true
#C3 = false
#C4 = static-tearoff self::O1::_#new#tearOff
#C5 = static-tearoff self::O2::_#new#tearOff
#C6 = static-tearoff self::P1::_#new#tearOff
#C7 = static-tearoff self::P2::_#new#tearOff
}

View file

@ -0,0 +1,73 @@
library;
import self as self;
import "dart:core" as core;
abstract class B extends core::Object /*hasConstConstructor*/ {
final field core::bool autofocus;
const constructor •({required core::bool autofocus = #C1}) → self::B
: self::B::autofocus = autofocus, super core::Object::•()
;
}
class O1 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = #C2}) → self::O1
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({core::bool autofocus = #C2}) → self::O1
return new self::O1::•(autofocus: autofocus);
}
class O2 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = #C2}) → self::O2
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({core::bool autofocus = #C2}) → self::O2
return new self::O2::•(autofocus: autofocus);
}
abstract class C extends core::Object /*hasConstConstructor*/ {
final field core::bool a;
final field core::bool b;
const constructor •({core::bool a = #C2, core::bool b = #C3}) → self::C
: self::C::a = a, self::C::b = b, super core::Object::•()
;
}
class P1 extends self::C /*hasConstConstructor*/ {
final field core::int c;
const constructor •(core::int c, {core::bool a = #C2, core::bool b = #C3}) → self::P1
: self::P1::c = c, super self::C::•(a: a, b: b)
;
static method _#new#tearOff(core::int c, {core::bool a = #C2, core::bool b = #C3}) → self::P1
return new self::P1::•(c, a: a, b: b);
}
class P2 extends self::C /*hasConstConstructor*/ {
const constructor •({core::bool b = #C3, core::bool a = #C2}) → self::P2
: super self::C::•(b: b, a: a)
;
static method _#new#tearOff({core::bool b = #C3, core::bool a = #C2}) → self::P2
return new self::P2::•(b: b, a: a);
}
static method main() → dynamic {
({autofocus: core::bool}) → self::O1 tearoff1 = #C4;
({autofocus: core::bool}) → self::O2 tearoff2 = #C5;
(core::int, {a: core::bool, b: core::bool}) → self::P1 tearoff3 = #C6;
({a: core::bool, b: core::bool}) → self::P2 tearoff4 = #C7;
self::expect(true, tearoff1(){({autofocus: core::bool}) → self::O1}.{self::B::autofocus}{core::bool});
self::expect(true, tearoff2(){({autofocus: core::bool}) → self::O2}.{self::B::autofocus}{core::bool});
self::expect(true, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::C::a}{core::bool});
self::expect(false, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::C::b}{core::bool});
self::expect(0, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::P1::c}{core::int});
self::expect(true, tearoff4(){({a: core::bool, b: core::bool}) → self::P2}.{self::C::a}{core::bool});
self::expect(false, tearoff4(){({a: core::bool, b: core::bool}) → self::P2}.{self::C::b}{core::bool});
}
static method expect(dynamic expected, dynamic actual) → dynamic {
if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual))
throw "Expected ${expected}, actual ${actual}";
}
constants {
#C1 = null
#C2 = true
#C3 = false
#C4 = static-tearoff self::O1::_#new#tearOff
#C5 = static-tearoff self::O2::_#new#tearOff
#C6 = static-tearoff self::P1::_#new#tearOff
#C7 = static-tearoff self::P2::_#new#tearOff
}

View file

@ -0,0 +1,30 @@
abstract class B {
final bool autofocus;
const B({required this.autofocus});
}
class O1 extends B {
const O1({bool autofocus = true}) : super(autofocus: autofocus);
}
class O2 extends B {
const O2({super.autofocus = true});
}
abstract class C {
final bool a;
final bool b;
const C({this.a = true, this.b = false});
}
class P1 extends C {
final int c;
const P1(this.c, {super.a, super.b});
}
class P2 extends C {
const P2({super.b, super.a});
}
main() {}
expect(expected, actual) {}

View file

@ -0,0 +1,30 @@
abstract class B {
const B({required this.autofocus});
final bool autofocus;
}
abstract class C {
const C({this.a = true, this.b = false});
final bool a;
final bool b;
}
class O1 extends B {
const O1({bool autofocus = true}) : super(autofocus: autofocus);
}
class O2 extends B {
const O2({super.autofocus = true});
}
class P1 extends C {
const P1(this.c, {super.a, super.b});
final int c;
}
class P2 extends C {
const P2({super.b, super.a});
}
expect(expected, actual) {}
main() {}

View file

@ -0,0 +1,73 @@
library;
import self as self;
import "dart:core" as core;
abstract class B extends core::Object /*hasConstConstructor*/ {
final field core::bool autofocus;
const constructor •({required core::bool autofocus = #C1}) → self::B
: self::B::autofocus = autofocus, super core::Object::•()
;
}
class O1 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = #C2}) → self::O1
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({core::bool autofocus = #C2}) → self::O1
return new self::O1::•(autofocus: autofocus);
}
class O2 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = #C2}) → self::O2
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({core::bool autofocus = #C2}) → self::O2
return new self::O2::•(autofocus: autofocus);
}
abstract class C extends core::Object /*hasConstConstructor*/ {
final field core::bool a;
final field core::bool b;
const constructor •({core::bool a = #C2, core::bool b = #C3}) → self::C
: self::C::a = a, self::C::b = b, super core::Object::•()
;
}
class P1 extends self::C /*hasConstConstructor*/ {
final field core::int c;
const constructor •(core::int c, {core::bool a = #C2, core::bool b = #C3}) → self::P1
: self::P1::c = c, super self::C::•(a: a, b: b)
;
static method _#new#tearOff(core::int c, {core::bool a = #C2, core::bool b = #C3}) → self::P1
return new self::P1::•(c, a: a, b: b);
}
class P2 extends self::C /*hasConstConstructor*/ {
const constructor •({core::bool b = #C3, core::bool a = #C2}) → self::P2
: super self::C::•(b: b, a: a)
;
static method _#new#tearOff({core::bool b = #C3, core::bool a = #C2}) → self::P2
return new self::P2::•(b: b, a: a);
}
static method main() → dynamic {
({autofocus: core::bool}) → self::O1 tearoff1 = #C4;
({autofocus: core::bool}) → self::O2 tearoff2 = #C5;
(core::int, {a: core::bool, b: core::bool}) → self::P1 tearoff3 = #C6;
({a: core::bool, b: core::bool}) → self::P2 tearoff4 = #C7;
self::expect(true, tearoff1(){({autofocus: core::bool}) → self::O1}.{self::B::autofocus}{core::bool});
self::expect(true, tearoff2(){({autofocus: core::bool}) → self::O2}.{self::B::autofocus}{core::bool});
self::expect(true, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::C::a}{core::bool});
self::expect(false, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::C::b}{core::bool});
self::expect(0, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::P1::c}{core::int});
self::expect(true, tearoff4(){({a: core::bool, b: core::bool}) → self::P2}.{self::C::a}{core::bool});
self::expect(false, tearoff4(){({a: core::bool, b: core::bool}) → self::P2}.{self::C::b}{core::bool});
}
static method expect(dynamic expected, dynamic actual) → dynamic {
if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual))
throw "Expected ${expected}, actual ${actual}";
}
constants {
#C1 = null
#C2 = true
#C3 = false
#C4 = static-tearoff self::O1::_#new#tearOff
#C5 = static-tearoff self::O2::_#new#tearOff
#C6 = static-tearoff self::P1::_#new#tearOff
#C7 = static-tearoff self::P2::_#new#tearOff
}

View file

@ -0,0 +1,73 @@
library;
import self as self;
import "dart:core" as core;
abstract class B extends core::Object /*hasConstConstructor*/ {
final field core::bool autofocus;
const constructor •({required core::bool autofocus = #C1}) → self::B
: self::B::autofocus = autofocus, super core::Object::•()
;
}
class O1 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = #C2}) → self::O1
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({core::bool autofocus = #C2}) → self::O1
return new self::O1::•(autofocus: autofocus);
}
class O2 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = #C2}) → self::O2
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({core::bool autofocus = #C2}) → self::O2
return new self::O2::•(autofocus: autofocus);
}
abstract class C extends core::Object /*hasConstConstructor*/ {
final field core::bool a;
final field core::bool b;
const constructor •({core::bool a = #C2, core::bool b = #C3}) → self::C
: self::C::a = a, self::C::b = b, super core::Object::•()
;
}
class P1 extends self::C /*hasConstConstructor*/ {
final field core::int c;
const constructor •(core::int c, {core::bool a = #C2, core::bool b = #C3}) → self::P1
: self::P1::c = c, super self::C::•(a: a, b: b)
;
static method _#new#tearOff(core::int c, {core::bool a = #C2, core::bool b = #C3}) → self::P1
return new self::P1::•(c, a: a, b: b);
}
class P2 extends self::C /*hasConstConstructor*/ {
const constructor •({core::bool b = #C3, core::bool a = #C2}) → self::P2
: super self::C::•(b: b, a: a)
;
static method _#new#tearOff({core::bool b = #C3, core::bool a = #C2}) → self::P2
return new self::P2::•(b: b, a: a);
}
static method main() → dynamic {
({autofocus: core::bool}) → self::O1 tearoff1 = #C4;
({autofocus: core::bool}) → self::O2 tearoff2 = #C5;
(core::int, {a: core::bool, b: core::bool}) → self::P1 tearoff3 = #C6;
({a: core::bool, b: core::bool}) → self::P2 tearoff4 = #C7;
self::expect(true, tearoff1(){({autofocus: core::bool}) → self::O1}.{self::B::autofocus}{core::bool});
self::expect(true, tearoff2(){({autofocus: core::bool}) → self::O2}.{self::B::autofocus}{core::bool});
self::expect(true, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::C::a}{core::bool});
self::expect(false, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::C::b}{core::bool});
self::expect(0, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::P1::c}{core::int});
self::expect(true, tearoff4(){({a: core::bool, b: core::bool}) → self::P2}.{self::C::a}{core::bool});
self::expect(false, tearoff4(){({a: core::bool, b: core::bool}) → self::P2}.{self::C::b}{core::bool});
}
static method expect(dynamic expected, dynamic actual) → dynamic {
if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual))
throw "Expected ${expected}, actual ${actual}";
}
constants {
#C1 = null
#C2 = true
#C3 = false
#C4 = static-tearoff self::O1::_#new#tearOff
#C5 = static-tearoff self::O2::_#new#tearOff
#C6 = static-tearoff self::P1::_#new#tearOff
#C7 = static-tearoff self::P2::_#new#tearOff
}

View file

@ -0,0 +1,50 @@
library;
import self as self;
import "dart:core" as core;
abstract class B extends core::Object /*hasConstConstructor*/ {
final field core::bool autofocus;
const constructor •({required core::bool autofocus = null}) → self::B
: self::B::autofocus = autofocus, super core::Object::•()
;
}
class O1 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = true}) → self::O1
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({has-declared-initializer core::bool autofocus}) → self::O1
return new self::O1::•(autofocus: autofocus);
}
class O2 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = true}) → self::O2
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({has-declared-initializer core::bool autofocus}) → self::O2
return new self::O2::•(autofocus: autofocus);
}
abstract class C extends core::Object /*hasConstConstructor*/ {
final field core::bool a;
final field core::bool b;
const constructor •({core::bool a = true, core::bool b = false}) → self::C
: self::C::a = a, self::C::b = b, super core::Object::•()
;
}
class P1 extends self::C /*hasConstConstructor*/ {
final field core::int c;
const constructor •(core::int c, {core::bool a = true, core::bool b = false}) → self::P1
: self::P1::c = c, super self::C::•(a: a, b: b)
;
static method _#new#tearOff(core::int c, {core::bool a = true, core::bool b = false}) → self::P1
return new self::P1::•(c, a: a, b: b);
}
class P2 extends self::C /*hasConstConstructor*/ {
const constructor •({core::bool b = false, core::bool a = true}) → self::P2
: super self::C::•(b: b, a: a)
;
static method _#new#tearOff({core::bool b = false, core::bool a = true}) → self::P2
return new self::P2::•(b: b, a: a);
}
static method main() → dynamic
;
static method expect(dynamic expected, dynamic actual) → dynamic
;

View file

@ -0,0 +1,73 @@
library;
import self as self;
import "dart:core" as core;
abstract class B extends core::Object /*hasConstConstructor*/ {
final field core::bool autofocus;
const constructor •({required core::bool autofocus = #C1}) → self::B
: self::B::autofocus = autofocus, super core::Object::•()
;
}
class O1 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = #C2}) → self::O1
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({core::bool autofocus = #C2}) → self::O1
return new self::O1::•(autofocus: autofocus);
}
class O2 extends self::B /*hasConstConstructor*/ {
const constructor •({core::bool autofocus = #C2}) → self::O2
: super self::B::•(autofocus: autofocus)
;
static method _#new#tearOff({core::bool autofocus = #C2}) → self::O2
return new self::O2::•(autofocus: autofocus);
}
abstract class C extends core::Object /*hasConstConstructor*/ {
final field core::bool a;
final field core::bool b;
const constructor •({core::bool a = #C2, core::bool b = #C3}) → self::C
: self::C::a = a, self::C::b = b, super core::Object::•()
;
}
class P1 extends self::C /*hasConstConstructor*/ {
final field core::int c;
const constructor •(core::int c, {core::bool a = #C2, core::bool b = #C3}) → self::P1
: self::P1::c = c, super self::C::•(a: a, b: b)
;
static method _#new#tearOff(core::int c, {core::bool a = #C2, core::bool b = #C3}) → self::P1
return new self::P1::•(c, a: a, b: b);
}
class P2 extends self::C /*hasConstConstructor*/ {
const constructor •({core::bool b = #C3, core::bool a = #C2}) → self::P2
: super self::C::•(b: b, a: a)
;
static method _#new#tearOff({core::bool b = #C3, core::bool a = #C2}) → self::P2
return new self::P2::•(b: b, a: a);
}
static method main() → dynamic {
({autofocus: core::bool}) → self::O1 tearoff1 = #C4;
({autofocus: core::bool}) → self::O2 tearoff2 = #C5;
(core::int, {a: core::bool, b: core::bool}) → self::P1 tearoff3 = #C6;
({a: core::bool, b: core::bool}) → self::P2 tearoff4 = #C7;
self::expect(true, tearoff1(){({autofocus: core::bool}) → self::O1}.{self::B::autofocus}{core::bool});
self::expect(true, tearoff2(){({autofocus: core::bool}) → self::O2}.{self::B::autofocus}{core::bool});
self::expect(true, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::C::a}{core::bool});
self::expect(false, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::C::b}{core::bool});
self::expect(0, tearoff3(0){(core::int, {a: core::bool, b: core::bool}) → self::P1}.{self::P1::c}{core::int});
self::expect(true, tearoff4(){({a: core::bool, b: core::bool}) → self::P2}.{self::C::a}{core::bool});
self::expect(false, tearoff4(){({a: core::bool, b: core::bool}) → self::P2}.{self::C::b}{core::bool});
}
static method expect(dynamic expected, dynamic actual) → dynamic {
if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual))
throw "Expected ${expected}, actual ${actual}";
}
constants {
#C1 = null
#C2 = true
#C3 = false
#C4 = static-tearoff self::O1::_#new#tearOff
#C5 = static-tearoff self::O2::_#new#tearOff
#C6 = static-tearoff self::P1::_#new#tearOff
#C7 = static-tearoff self::P2::_#new#tearOff
}

View file

@ -14,7 +14,7 @@ import self as self;
import "dart:core" as core;
abstract class A extends core::Object {
constructor •({required invalid-type field = null}) → self::A
constructor •({required invalid-type field}) → self::A
;
}
class C extends core::Object {

View file

@ -3,7 +3,7 @@ import self as self;
import "dart:core" as core;
class A extends self::B {
constructor •({required invalid-type field = null}) → self::A
constructor •({required invalid-type field}) → self::A
;
}
class B extends core::Object {

View file

@ -3,7 +3,7 @@ import self as self;
import "dart:core" as core;
class A extends self::B {
constructor •({required invalid-type field = null}) → self::A
constructor •({required invalid-type field}) → self::A
;
}
class B extends core::Object {
@ -12,7 +12,7 @@ class B extends core::Object {
;
}
class C extends self::D {
constructor •({required core::int field = null}) → self::C
constructor •({required core::int field}) → self::C
;
}
class D extends core::Object {

View file

@ -35,7 +35,7 @@ library from "org-dartlang-test:///main.dart" as main {
const constructor •({fra::Key? key = #C1}) → main::GalleryApp
: super fra::StatefulWidget::•(key: key)
;
static method _#new#tearOff({fra::Key? key}) → main::GalleryApp
static method _#new#tearOff({fra::Key? key = #C1}) → main::GalleryApp
return new main::GalleryApp::•(key: key);
}
}

View file

@ -110,6 +110,74 @@ class S9 {
S9([int x = 0]) : s = x - 1;
}
class S5b {
num a;
S5b({num x = 3.14}) : a = x - 1;
}
class C5b extends S5b {
C5b({int super.x}); // Error.
}
class S6b {
num? a;
S6b({num? x = 3.14}) : a = x;
}
class C6b extends S6b {
int? b;
C6b({int? super.x}); // Ok.
}
class D6b extends C6b {
D6b({int super.x}); // Error
}
class S7b {
int s;
S7b({int x = 0}) : s = x - 1;
}
class C7b extends S7b {
int c;
C7b({super.x}) : c = x + 1;
}
class CC7b extends C7b {
int cc;
CC7b({super.x}) : cc = x * 1;
}
class S8b {
final int s;
const S8b({int x = 0}) : s = x - 1;
}
class CC8b extends C8b {
final int cc;
const CC8b({super.x}) : cc = x * 1;
}
class C8b extends S8b {
final int c;
const C8b({super.x}) : c = x + 1;
}
class CC9b extends C9b {
int cc;
CC9b({super.x}) : cc = x * 1;
}
class C9b extends S9b {
int c;
C9b({super.x}) : c = x + 1;
}
class S9b {
int s;
S9b({int x = 0}) : s = x - 1;
}
class Ap {
Ap([num x = 3.14]);
}

View file

@ -10,11 +10,19 @@ library;
// D6([int super.x]); // Error
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:118:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// pkg/front_end/testcases/super_parameters/default_values.dart:119:18: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// C5b({int super.x}); // Error.
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:133:18: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// D6b({int super.x}); // Error
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:186:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// Bp([int super.x]); // Error.
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:127:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// pkg/front_end/testcases/super_parameters/default_values.dart:195:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// Bn({int super.x}); // Error.
// ^
//
@ -151,6 +159,88 @@ class S9 extends core::Object {
: self::S9::s = x.{core::num::-}(1){(core::num) → core::int}, super core::Object::•()
;
}
class S5b extends core::Object {
field core::num a;
constructor •({core::num x = #C3}) → self::S5b
: self::S5b::a = x.{core::num::-}(1){(core::num) → core::num}, super core::Object::•()
;
}
class C5b extends self::S5b {
constructor •({core::int x = #C4}) → self::C5b
: super self::S5b::•(x: x)
;
}
class S6b extends core::Object {
field core::num? a;
constructor •({core::num? x = #C3}) → self::S6b
: self::S6b::a = x, super core::Object::•()
;
}
class C6b extends self::S6b {
field core::int? b = null;
constructor •({core::int? x = #C4}) → self::C6b
: super self::S6b::•(x: x)
;
}
class D6b extends self::C6b {
constructor •({core::int x = #C4}) → self::D6b
: super self::C6b::•(x: x)
;
}
class S7b extends core::Object {
field core::int s;
constructor •({core::int x = #C1}) → self::S7b
: self::S7b::s = x.{core::num::-}(1){(core::num) → core::int}, super core::Object::•()
;
}
class C7b extends self::S7b {
field core::int c;
constructor •({core::int x = #C1}) → self::C7b
: self::C7b::c = x.{core::num::+}(1){(core::num) → core::int}, super self::S7b::•(x: x)
;
}
class CC7b extends self::C7b {
field core::int cc;
constructor •({core::int x = #C1}) → self::CC7b
: self::CC7b::cc = x.{core::num::*}(1){(core::num) → core::int}, super self::C7b::•(x: x)
;
}
class S8b extends core::Object /*hasConstConstructor*/ {
final field core::int s;
const constructor •({core::int x = #C1}) → self::S8b
: self::S8b::s = x.{core::num::-}(1){(core::num) → core::int}, super core::Object::•()
;
}
class CC8b extends self::C8b /*hasConstConstructor*/ {
final field core::int cc;
const constructor •({core::int x = #C1}) → self::CC8b
: self::CC8b::cc = x.{core::num::*}(1){(core::num) → core::int}, super self::C8b::•(x: x)
;
}
class C8b extends self::S8b /*hasConstConstructor*/ {
final field core::int c;
const constructor •({core::int x = #C1}) → self::C8b
: self::C8b::c = x.{core::num::+}(1){(core::num) → core::int}, super self::S8b::•(x: x)
;
}
class CC9b extends self::C9b {
field core::int cc;
constructor •({core::int x = #C1}) → self::CC9b
: self::CC9b::cc = x.{core::num::*}(1){(core::num) → core::int}, super self::C9b::•(x: x)
;
}
class C9b extends self::S9b {
field core::int c;
constructor •({core::int x = #C1}) → self::C9b
: self::C9b::c = x.{core::num::+}(1){(core::num) → core::int}, super self::S9b::•(x: x)
;
}
class S9b extends core::Object {
field core::int s;
constructor •({core::int x = #C1}) → self::S9b
: self::S9b::s = x.{core::num::-}(1){(core::num) → core::int}, super core::Object::•()
;
}
class Ap extends core::Object {
constructor •([core::num x = #C3]) → self::Ap
: super core::Object::•()

View file

@ -10,11 +10,19 @@ library;
// D6([int super.x]); // Error
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:118:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// pkg/front_end/testcases/super_parameters/default_values.dart:119:18: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// C5b({int super.x}); // Error.
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:133:18: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// D6b({int super.x}); // Error
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:186:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// Bp([int super.x]); // Error.
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:127:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// pkg/front_end/testcases/super_parameters/default_values.dart:195:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// Bn({int super.x}); // Error.
// ^
//
@ -151,6 +159,88 @@ class S9 extends core::Object {
: self::S9::s = x.{core::num::-}(1){(core::num) → core::int}, super core::Object::•()
;
}
class S5b extends core::Object {
field core::num a;
constructor •({core::num x = #C3}) → self::S5b
: self::S5b::a = x.{core::num::-}(1){(core::num) → core::num}, super core::Object::•()
;
}
class C5b extends self::S5b {
constructor •({core::int x = #C4}) → self::C5b
: super self::S5b::•(x: x)
;
}
class S6b extends core::Object {
field core::num? a;
constructor •({core::num? x = #C3}) → self::S6b
: self::S6b::a = x, super core::Object::•()
;
}
class C6b extends self::S6b {
field core::int? b = null;
constructor •({core::int? x = #C4}) → self::C6b
: super self::S6b::•(x: x)
;
}
class D6b extends self::C6b {
constructor •({core::int x = #C4}) → self::D6b
: super self::C6b::•(x: x)
;
}
class S7b extends core::Object {
field core::int s;
constructor •({core::int x = #C1}) → self::S7b
: self::S7b::s = x.{core::num::-}(1){(core::num) → core::int}, super core::Object::•()
;
}
class C7b extends self::S7b {
field core::int c;
constructor •({core::int x = #C1}) → self::C7b
: self::C7b::c = x.{core::num::+}(1){(core::num) → core::int}, super self::S7b::•(x: x)
;
}
class CC7b extends self::C7b {
field core::int cc;
constructor •({core::int x = #C1}) → self::CC7b
: self::CC7b::cc = x.{core::num::*}(1){(core::num) → core::int}, super self::C7b::•(x: x)
;
}
class S8b extends core::Object /*hasConstConstructor*/ {
final field core::int s;
const constructor •({core::int x = #C1}) → self::S8b
: self::S8b::s = x.{core::num::-}(1){(core::num) → core::int}, super core::Object::•()
;
}
class CC8b extends self::C8b /*hasConstConstructor*/ {
final field core::int cc;
const constructor •({core::int x = #C1}) → self::CC8b
: self::CC8b::cc = x.{core::num::*}(1){(core::num) → core::int}, super self::C8b::•(x: x)
;
}
class C8b extends self::S8b /*hasConstConstructor*/ {
final field core::int c;
const constructor •({core::int x = #C1}) → self::C8b
: self::C8b::c = x.{core::num::+}(1){(core::num) → core::int}, super self::S8b::•(x: x)
;
}
class CC9b extends self::C9b {
field core::int cc;
constructor •({core::int x = #C1}) → self::CC9b
: self::CC9b::cc = x.{core::num::*}(1){(core::num) → core::int}, super self::C9b::•(x: x)
;
}
class C9b extends self::S9b {
field core::int c;
constructor •({core::int x = #C1}) → self::C9b
: self::C9b::c = x.{core::num::+}(1){(core::num) → core::int}, super self::S9b::•(x: x)
;
}
class S9b extends core::Object {
field core::int s;
constructor •({core::int x = #C1}) → self::S9b
: self::S9b::s = x.{core::num::-}(1){(core::num) → core::int}, super core::Object::•()
;
}
class Ap extends core::Object {
constructor •([core::num x = #C3]) → self::Ap
: super core::Object::•()

View file

@ -106,6 +106,74 @@ class S9 {
S9([int x = 0]) : s = x - 1;
}
class S5b {
num a;
S5b({num x = 3.14}) : a = x - 1;
}
class C5b extends S5b {
C5b({int super.x});
}
class S6b {
num? a;
S6b({num? x = 3.14}) : a = x;
}
class C6b extends S6b {
int? b;
C6b({int? super.x});
}
class D6b extends C6b {
D6b({int super.x});
}
class S7b {
int s;
S7b({int x = 0}) : s = x - 1;
}
class C7b extends S7b {
int c;
C7b({super.x}) : c = x + 1;
}
class CC7b extends C7b {
int cc;
CC7b({super.x}) : cc = x * 1;
}
class S8b {
final int s;
const S8b({int x = 0}) : s = x - 1;
}
class CC8b extends C8b {
final int cc;
const CC8b({super.x}) : cc = x * 1;
}
class C8b extends S8b {
final int c;
const C8b({super.x}) : c = x + 1;
}
class CC9b extends C9b {
int cc;
CC9b({super.x}) : cc = x * 1;
}
class C9b extends S9b {
int c;
C9b({super.x}) : c = x + 1;
}
class S9b {
int s;
S9b({int x = 0}) : s = x - 1;
}
class Ap {
Ap([num x = 3.14]);
}

View file

@ -40,45 +40,88 @@ class C5 extends S5 {
C5([int super.x]);
}
class C5b extends S5b {
C5b({int super.x});
}
class C6 extends S6 {
C6([int? super.x]);
int? b;
}
class C6b extends S6b {
C6b({int? super.x});
int? b;
}
class C7 extends S7 {
C7([super.x]) : c = x + 1;
int c;
}
class C7b extends S7b {
C7b({super.x}) : c = x + 1;
int c;
}
class C8 extends S8 {
C8([super.x]) : c = x + 1;
int c;
}
class C8b extends S8b {
const C8b({super.x}) : c = x + 1;
final int c;
}
class C9 extends S9 {
C9([super.x]) : c = x + 1;
int c;
}
class C9b extends S9b {
C9b({super.x}) : c = x + 1;
int c;
}
class CC7 extends C7 {
CC7([super.x]) : cc = x * 1;
int cc;
}
class CC7b extends C7b {
CC7b({super.x}) : cc = x * 1;
int cc;
}
class CC8 extends C8 {
CC8([super.x]) : cc = x * 1;
int cc;
}
class CC8b extends C8b {
const CC8b({super.x}) : cc = x * 1;
final int cc;
}
class CC9 extends C9 {
CC9([super.x]) : cc = x * 1;
int cc;
}
class CC9b extends C9b {
CC9b({super.x}) : cc = x * 1;
int cc;
}
class D6 extends C6 {
D6([int super.x]);
}
class D6b extends C6b {
D6b({int super.x});
}
class S1 {
S1([int x = 0]) : s = x - 1;
int s;
@ -104,24 +147,49 @@ class S5 {
num a;
}
class S5b {
S5b({num x = 3.14}) : a = x - 1;
num a;
}
class S6 {
S6([num? x = 3.14]) : a = x;
num? a;
}
class S6b {
S6b({num? x = 3.14}) : a = x;
num? a;
}
class S7 {
S7([int x = 0]) : s = x - 1;
int s;
}
class S7b {
S7b({int x = 0}) : s = x - 1;
int s;
}
class S8 {
S8([int x = 0]) : s = x - 1;
int s;
}
class S8b {
const S8b({int x = 0}) : s = x - 1;
final int s;
}
class S9 {
S9([int x = 0]) : s = x - 1;
int s;
}
class S9b {
S9b({int x = 0}) : s = x - 1;
int s;
}
main() {}

View file

@ -10,11 +10,19 @@ library;
// D6([int super.x]); // Error
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:118:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// pkg/front_end/testcases/super_parameters/default_values.dart:119:18: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// C5b({int super.x}); // Error.
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:133:18: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// D6b({int super.x}); // Error
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:186:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// Bp([int super.x]); // Error.
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:127:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// pkg/front_end/testcases/super_parameters/default_values.dart:195:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// Bn({int super.x}); // Error.
// ^
//
@ -151,6 +159,88 @@ class S9 extends core::Object {
: self::S9::s = x.{core::num::-}(1){(core::num) → core::int}, super core::Object::•()
;
}
class S5b extends core::Object {
field core::num a;
constructor •({core::num x = #C3}) → self::S5b
: self::S5b::a = x.{core::num::-}(1){(core::num) → core::num}, super core::Object::•()
;
}
class C5b extends self::S5b {
constructor •({core::int x = #C4}) → self::C5b
: super self::S5b::•(x: x)
;
}
class S6b extends core::Object {
field core::num? a;
constructor •({core::num? x = #C3}) → self::S6b
: self::S6b::a = x, super core::Object::•()
;
}
class C6b extends self::S6b {
field core::int? b = null;
constructor •({core::int? x = #C4}) → self::C6b
: super self::S6b::•(x: x)
;
}
class D6b extends self::C6b {
constructor •({core::int x = #C4}) → self::D6b
: super self::C6b::•(x: x)
;
}
class S7b extends core::Object {
field core::int s;
constructor •({core::int x = #C1}) → self::S7b
: self::S7b::s = x.{core::num::-}(1){(core::num) → core::int}, super core::Object::•()
;
}
class C7b extends self::S7b {
field core::int c;
constructor •({core::int x = #C1}) → self::C7b
: self::C7b::c = x.{core::num::+}(1){(core::num) → core::int}, super self::S7b::•(x: x)
;
}
class CC7b extends self::C7b {
field core::int cc;
constructor •({core::int x = #C1}) → self::CC7b
: self::CC7b::cc = x.{core::num::*}(1){(core::num) → core::int}, super self::C7b::•(x: x)
;
}
class S8b extends core::Object /*hasConstConstructor*/ {
final field core::int s;
const constructor •({core::int x = #C1}) → self::S8b
: self::S8b::s = x.{core::num::-}(1){(core::num) → core::int}, super core::Object::•()
;
}
class CC8b extends self::C8b /*hasConstConstructor*/ {
final field core::int cc;
const constructor •({core::int x = #C1}) → self::CC8b
: self::CC8b::cc = x.{core::num::*}(1){(core::num) → core::int}, super self::C8b::•(x: x)
;
}
class C8b extends self::S8b /*hasConstConstructor*/ {
final field core::int c;
const constructor •({core::int x = #C1}) → self::C8b
: self::C8b::c = x.{core::num::+}(1){(core::num) → core::int}, super self::S8b::•(x: x)
;
}
class CC9b extends self::C9b {
field core::int cc;
constructor •({core::int x = #C1}) → self::CC9b
: self::CC9b::cc = x.{core::num::*}(1){(core::num) → core::int}, super self::C9b::•(x: x)
;
}
class C9b extends self::S9b {
field core::int c;
constructor •({core::int x = #C1}) → self::C9b
: self::C9b::c = x.{core::num::+}(1){(core::num) → core::int}, super self::S9b::•(x: x)
;
}
class S9b extends core::Object {
field core::int s;
constructor •({core::int x = #C1}) → self::S9b
: self::S9b::s = x.{core::num::-}(1){(core::num) → core::int}, super core::Object::•()
;
}
class Ap extends core::Object {
constructor •([core::num x = #C3]) → self::Ap
: super core::Object::•()

View file

@ -10,11 +10,19 @@ library;
// D6([int super.x]); // Error
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:118:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// pkg/front_end/testcases/super_parameters/default_values.dart:119:18: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// C5b({int super.x}); // Error.
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:133:18: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// D6b({int super.x}); // Error
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:186:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// Bp([int super.x]); // Error.
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:127:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// pkg/front_end/testcases/super_parameters/default_values.dart:195:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// Bn({int super.x}); // Error.
// ^
//
@ -151,6 +159,88 @@ class S9 extends core::Object {
: self::S9::s = x.{core::num::-}(1){(core::num) → core::int}, super core::Object::•()
;
}
class S5b extends core::Object {
field core::num a;
constructor •({core::num x = #C3}) → self::S5b
: self::S5b::a = x.{core::num::-}(1){(core::num) → core::num}, super core::Object::•()
;
}
class C5b extends self::S5b {
constructor •({core::int x = #C4}) → self::C5b
: super self::S5b::•(x: x)
;
}
class S6b extends core::Object {
field core::num? a;
constructor •({core::num? x = #C3}) → self::S6b
: self::S6b::a = x, super core::Object::•()
;
}
class C6b extends self::S6b {
field core::int? b = null;
constructor •({core::int? x = #C4}) → self::C6b
: super self::S6b::•(x: x)
;
}
class D6b extends self::C6b {
constructor •({core::int x = #C4}) → self::D6b
: super self::C6b::•(x: x)
;
}
class S7b extends core::Object {
field core::int s;
constructor •({core::int x = #C1}) → self::S7b
: self::S7b::s = x.{core::num::-}(1){(core::num) → core::int}, super core::Object::•()
;
}
class C7b extends self::S7b {
field core::int c;
constructor •({core::int x = #C1}) → self::C7b
: self::C7b::c = x.{core::num::+}(1){(core::num) → core::int}, super self::S7b::•(x: x)
;
}
class CC7b extends self::C7b {
field core::int cc;
constructor •({core::int x = #C1}) → self::CC7b
: self::CC7b::cc = x.{core::num::*}(1){(core::num) → core::int}, super self::C7b::•(x: x)
;
}
class S8b extends core::Object /*hasConstConstructor*/ {
final field core::int s;
const constructor •({core::int x = #C1}) → self::S8b
: self::S8b::s = x.{core::num::-}(1){(core::num) → core::int}, super core::Object::•()
;
}
class CC8b extends self::C8b /*hasConstConstructor*/ {
final field core::int cc;
const constructor •({core::int x = #C1}) → self::CC8b
: self::CC8b::cc = x.{core::num::*}(1){(core::num) → core::int}, super self::C8b::•(x: x)
;
}
class C8b extends self::S8b /*hasConstConstructor*/ {
final field core::int c;
const constructor •({core::int x = #C1}) → self::C8b
: self::C8b::c = x.{core::num::+}(1){(core::num) → core::int}, super self::S8b::•(x: x)
;
}
class CC9b extends self::C9b {
field core::int cc;
constructor •({core::int x = #C1}) → self::CC9b
: self::CC9b::cc = x.{core::num::*}(1){(core::num) → core::int}, super self::C9b::•(x: x)
;
}
class C9b extends self::S9b {
field core::int c;
constructor •({core::int x = #C1}) → self::C9b
: self::C9b::c = x.{core::num::+}(1){(core::num) → core::int}, super self::S9b::•(x: x)
;
}
class S9b extends core::Object {
field core::int s;
constructor •({core::int x = #C1}) → self::S9b
: self::S9b::s = x.{core::num::-}(1){(core::num) → core::int}, super core::Object::•()
;
}
class Ap extends core::Object {
constructor •([core::num x = #C3]) → self::Ap
: super core::Object::•()

View file

@ -10,11 +10,19 @@ library;
// D6([int super.x]); // Error
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:118:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// pkg/front_end/testcases/super_parameters/default_values.dart:119:18: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// C5b({int super.x}); // Error.
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:133:18: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// D6b({int super.x}); // Error
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:186:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// Bp([int super.x]); // Error.
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:127:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// pkg/front_end/testcases/super_parameters/default_values.dart:195:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// Bn({int super.x}); // Error.
// ^
//
@ -67,7 +75,7 @@ class S5 extends core::Object {
;
}
class C5 extends self::S5 {
constructor •([core::int x = null]) → self::C5
constructor •([core::int x]) → self::C5
;
}
class S6 extends core::Object {
@ -77,11 +85,11 @@ class S6 extends core::Object {
}
class C6 extends self::S6 {
field core::int? b;
constructor •([core::int? x = null]) → self::C6
constructor •([core::int? x]) → self::C6
;
}
class D6 extends self::C6 {
constructor •([core::int x = null]) → self::D6
constructor •([core::int x]) → self::D6
;
}
class S7 extends core::Object {
@ -129,12 +137,83 @@ class S9 extends core::Object {
constructor •([core::int x = 0]) → self::S9
;
}
class S5b extends core::Object {
field core::num a;
constructor •({core::num x = 3.14}) → self::S5b
;
}
class C5b extends self::S5b {
constructor •({core::int x}) → self::C5b
;
}
class S6b extends core::Object {
field core::num? a;
constructor •({core::num? x = 3.14}) → self::S6b
;
}
class C6b extends self::S6b {
field core::int? b;
constructor •({core::int? x}) → self::C6b
;
}
class D6b extends self::C6b {
constructor •({core::int x}) → self::D6b
;
}
class S7b extends core::Object {
field core::int s;
constructor •({core::int x = 0}) → self::S7b
;
}
class C7b extends self::S7b {
field core::int c;
constructor •({core::int x = 0}) → self::C7b
;
}
class CC7b extends self::C7b {
field core::int cc;
constructor •({core::int x = 0}) → self::CC7b
;
}
class S8b extends core::Object /*hasConstConstructor*/ {
final field core::int s;
const constructor •({core::int x = 0}) → self::S8b
: self::S8b::s = x.{core::num::-}(1){(core::num) → core::int}, super core::Object::•()
;
}
class CC8b extends self::C8b /*hasConstConstructor*/ {
final field core::int cc;
const constructor •({core::int x = 0}) → self::CC8b
: self::CC8b::cc = x.{core::num::*}(1){(core::num) → core::int}, super self::C8b::•(x: x)
;
}
class C8b extends self::S8b /*hasConstConstructor*/ {
final field core::int c;
const constructor •({core::int x = 0}) → self::C8b
: self::C8b::c = x.{core::num::+}(1){(core::num) → core::int}, super self::S8b::•(x: x)
;
}
class CC9b extends self::C9b {
field core::int cc;
constructor •({core::int x = 0}) → self::CC9b
;
}
class C9b extends self::S9b {
field core::int c;
constructor •({core::int x = 0}) → self::C9b
;
}
class S9b extends core::Object {
field core::int s;
constructor •({core::int x = 0}) → self::S9b
;
}
class Ap extends core::Object {
constructor •([core::num x = 3.14]) → self::Ap
;
}
class Bp extends self::Ap {
constructor •([core::int x = null]) → self::Bp
constructor •([core::int x]) → self::Bp
;
constructor req(core::int x) → self::Bp
;
@ -144,9 +223,9 @@ class An extends core::Object {
;
}
class Bn extends self::An {
constructor •({core::int x = null}) → self::Bn
constructor •({core::int x}) → self::Bn
;
constructor req({required core::int x = null}) → self::Bn
constructor req({required core::int x}) → self::Bn
;
}
static method main() → dynamic

View file

@ -10,11 +10,19 @@ library;
// D6([int super.x]); // Error
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:118:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// pkg/front_end/testcases/super_parameters/default_values.dart:119:18: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// C5b({int super.x}); // Error.
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:133:18: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// D6b({int super.x}); // Error
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:186:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// Bp([int super.x]); // Error.
// ^
//
// pkg/front_end/testcases/super_parameters/default_values.dart:127:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// pkg/front_end/testcases/super_parameters/default_values.dart:195:17: Error: Type 'int' of the optional super-initializer parameter 'x' doesn't allow 'null', but the parameter doesn't have a default value, and the default value can't be copied from the corresponding parameter of the super constructor.
// Bn({int super.x}); // Error.
// ^
//
@ -151,6 +159,88 @@ class S9 extends core::Object {
: self::S9::s = x.{core::num::-}(1){(core::num) → core::int}, super core::Object::•()
;
}
class S5b extends core::Object {
field core::num a;
constructor •({core::num x = #C3}) → self::S5b
: self::S5b::a = x.{core::num::-}(1){(core::num) → core::num}, super core::Object::•()
;
}
class C5b extends self::S5b {
constructor •({core::int x = #C4}) → self::C5b
: super self::S5b::•(x: x)
;
}
class S6b extends core::Object {
field core::num? a;
constructor •({core::num? x = #C3}) → self::S6b
: self::S6b::a = x, super core::Object::•()
;
}
class C6b extends self::S6b {
field core::int? b = null;
constructor •({core::int? x = #C4}) → self::C6b
: super self::S6b::•(x: x)
;
}
class D6b extends self::C6b {
constructor •({core::int x = #C4}) → self::D6b
: super self::C6b::•(x: x)
;
}
class S7b extends core::Object {
field core::int s;
constructor •({core::int x = #C1}) → self::S7b
: self::S7b::s = x.{core::num::-}(1){(core::num) → core::int}, super core::Object::•()
;
}
class C7b extends self::S7b {
field core::int c;
constructor •({core::int x = #C1}) → self::C7b
: self::C7b::c = x.{core::num::+}(1){(core::num) → core::int}, super self::S7b::•(x: x)
;
}
class CC7b extends self::C7b {
field core::int cc;
constructor •({core::int x = #C1}) → self::CC7b
: self::CC7b::cc = x.{core::num::*}(1){(core::num) → core::int}, super self::C7b::•(x: x)
;
}
class S8b extends core::Object /*hasConstConstructor*/ {
final field core::int s;
const constructor •({core::int x = #C1}) → self::S8b
: self::S8b::s = x.{core::num::-}(1){(core::num) → core::int}, super core::Object::•()
;
}
class CC8b extends self::C8b /*hasConstConstructor*/ {
final field core::int cc;
const constructor •({core::int x = #C1}) → self::CC8b
: self::CC8b::cc = x.{core::num::*}(1){(core::num) → core::int}, super self::C8b::•(x: x)
;
}
class C8b extends self::S8b /*hasConstConstructor*/ {
final field core::int c;
const constructor •({core::int x = #C1}) → self::C8b
: self::C8b::c = x.{core::num::+}(1){(core::num) → core::int}, super self::S8b::•(x: x)
;
}
class CC9b extends self::C9b {
field core::int cc;
constructor •({core::int x = #C1}) → self::CC9b
: self::CC9b::cc = x.{core::num::*}(1){(core::num) → core::int}, super self::C9b::•(x: x)
;
}
class C9b extends self::S9b {
field core::int c;
constructor •({core::int x = #C1}) → self::C9b
: self::C9b::c = x.{core::num::+}(1){(core::num) → core::int}, super self::S9b::•(x: x)
;
}
class S9b extends core::Object {
field core::int s;
constructor •({core::int x = #C1}) → self::S9b
: self::S9b::s = x.{core::num::-}(1){(core::num) → core::int}, super core::Object::•()
;
}
class Ap extends core::Object {
constructor •([core::num x = #C3]) → self::Ap
: super core::Object::•()

View file

@ -19,7 +19,7 @@ abstract class _C&B&Mixin = self::B<self::A> with self::Mixin /*isAnonymousMixin
;
}
class C extends self::_C&B&Mixin {
constructor •({required self::A field = null}) → self::C
constructor •({required self::A field}) → self::C
;
}
static method main() → dynamic

View file

@ -17,9 +17,9 @@ class A2 extends core::Object {
;
}
class B2 extends self::A2 {
constructor one({required dynamic x = null}) → self::B2
constructor one({required dynamic x}) → self::B2
;
constructor two({required dynamic x = null}) → self::B2
constructor two({required dynamic x}) → self::B2
;
}
class A3 extends core::Object {
@ -37,9 +37,9 @@ class A4 extends core::Object {
;
}
class B4 extends self::A4 {
constructor one({required <X extends core::Object? = dynamic>(core::double) → X% f = null}) → self::B4
constructor one({required <X extends core::Object? = dynamic>(core::double) → X% f}) → self::B4
;
constructor two({required <X extends core::Object? = dynamic>(core::double) → X% f = null}) → self::B4
constructor two({required <X extends core::Object? = dynamic>(core::double) → X% f}) → self::B4
;
}
abstract class C5 extends core::Object {
@ -62,9 +62,9 @@ class A6 extends core::Object {
;
}
class B6 extends self::A6 {
constructor one({required self::C5 f = null}) → self::B6
constructor one({required self::C5 f}) → self::B6
;
constructor two({required self::C5 f = null}) → self::B6
constructor two({required self::C5 f}) → self::B6
;
}
class A7 extends core::Object {
@ -72,7 +72,7 @@ class A7 extends core::Object {
;
}
class B7 extends self::A7 {
constructor •({required dynamic x1 = null, required dynamic x2 = null, required <X extends core::Object? = dynamic>(core::Object) → X% f1 = null, required <X extends core::Object? = dynamic>(core::Object) → X% f2 = null, required <X extends core::Object? = dynamic>(X%) → void g1 = null, required <X extends core::Object? = dynamic>(X%) → void g2 = null}) → self::B7
constructor •({required dynamic x1, required dynamic x2 = null, required <X extends core::Object? = dynamic>(core::Object) → X% f1, required <X extends core::Object? = dynamic>(core::Object) → X% f2 = null, required <X extends core::Object? = dynamic>(X%) → void g1, required <X extends core::Object? = dynamic>(X%) → void g2 = null}) → self::B7
;
}
static method main() → dynamic

View file

@ -20,7 +20,7 @@ class B1 extends self::A1 {
;
constructor named2(core::int foo) → self::B1
;
constructor named3({required core::int foo = null}) → self::B1
constructor named3({required core::int foo}) → self::B1
;
}
class A2 extends core::Object {
@ -30,7 +30,7 @@ class A2 extends core::Object {
;
}
class B2 extends self::A2 {
constructor •({required core::String bar = null, required core::int foo = null}) → self::B2
constructor •({required core::String bar, required core::int foo}) → self::B2
;
}
static method main() → dynamic

View file

@ -8,11 +8,11 @@ class A1 extends core::Object {
;
}
class B1 extends self::A1 {
constructor •({required core::int foo = null}) → self::B1
constructor •({required core::int foo}) → self::B1
;
}
class C1 extends self::A1 {
constructor •({required core::int foo = null}) → self::C1
constructor •({required core::int foo}) → self::C1
;
}
class A2 extends core::Object {
@ -26,9 +26,9 @@ class B2 extends self::A2 {
;
}
class C2 extends self::A2 {
constructor •({required core::int foo = null}) → self::C2
constructor •({required core::int foo}) → self::C2
;
constructor other({required core::int foo = null}) → self::C2
constructor other({required core::int foo}) → self::C2
;
}
static method main() → dynamic