[cfe][PrimaryConstructors] Update reporting for mixin class with initializer/constructor body
This update the position used for reporting a mixin class primary constructor with a primary constructor by declaration with initializers or an explicit body. Since mixin classes can have simple constructors, it makes more sense to report the error on the offending syntax than on the primary constructor itself. The CL also updates the offset used for field initializers to the field name rather than the `=`. This align the offset with what is used for property sets. Change-Id: Id5ccd55536b2c3b9d9336d2854772c1bcc5a175a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/490800 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Erik Ernst <eernst@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
committed by
Commit Queue
parent
e7f818b866
commit
4cfd3da965
@@ -153,6 +153,8 @@ mixin _ConstructorDeclarationMixin
|
||||
|
||||
List<SourceNominalParameterBuilder>? get _typeParameters;
|
||||
|
||||
bool get _isPrimaryConstructor;
|
||||
|
||||
late final List<FormalParameterBuilder>? _initializerScopeParameters =
|
||||
_computeInitializerScopeParameters();
|
||||
|
||||
@@ -598,6 +600,7 @@ mixin _ConstructorDeclarationMixin
|
||||
fileUri: fileUri,
|
||||
beginInitializers: _beginInitializers!,
|
||||
isConst: isConst,
|
||||
forPrimaryConstructor: _isPrimaryConstructor,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1037,6 +1040,9 @@ class RegularConstructorDeclaration
|
||||
typeParameterScope: _fragment.typeParameterScope,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
bool get _isPrimaryConstructor => false;
|
||||
}
|
||||
|
||||
class DefaultEnumConstructorDeclaration
|
||||
@@ -1190,6 +1196,9 @@ class DefaultEnumConstructorDeclaration
|
||||
@override
|
||||
// Coverage-ignore(suite): Not run.
|
||||
String? get _nativeMethodName => null;
|
||||
|
||||
@override
|
||||
bool get _isPrimaryConstructor => false;
|
||||
}
|
||||
|
||||
class PrimaryConstructorDeclaration
|
||||
@@ -1434,6 +1443,9 @@ class PrimaryConstructorDeclaration
|
||||
|
||||
@override
|
||||
Uri get fileUri => _fragment.fileUri;
|
||||
|
||||
@override
|
||||
bool get _isPrimaryConstructor => true;
|
||||
}
|
||||
|
||||
/// Interface for using a [ConstructorFragment] or [PrimaryConstructorFragment]
|
||||
|
||||
@@ -1125,7 +1125,6 @@ class BodyBuilderImpl extends StackListenerImpl
|
||||
initializers = createFieldInitializer(
|
||||
formal.name,
|
||||
formal.fileOffset,
|
||||
formal.fileOffset,
|
||||
new VariableGet(formal.variable)
|
||||
..fileOffset = formal.fileOffset,
|
||||
formal: formal,
|
||||
@@ -9895,7 +9894,6 @@ class BodyBuilderImpl extends StackListenerImpl
|
||||
List<Initializer> createFieldInitializer(
|
||||
String name,
|
||||
int fieldNameOffset,
|
||||
int assignmentOffset,
|
||||
Expression expression, {
|
||||
FormalParameterBuilder? formal,
|
||||
}) {
|
||||
@@ -9960,12 +9958,12 @@ class BodyBuilderImpl extends StackListenerImpl
|
||||
builder,
|
||||
expression,
|
||||
name,
|
||||
assignmentOffset,
|
||||
fieldNameOffset,
|
||||
initializedFields![name]!,
|
||||
),
|
||||
];
|
||||
}
|
||||
initializedFields![name] = assignmentOffset;
|
||||
initializedFields![name] = fieldNameOffset;
|
||||
if (builder.hasAbstractField) {
|
||||
return <Initializer>[
|
||||
extern.createInvalidInitializer(
|
||||
@@ -9996,7 +9994,7 @@ class BodyBuilderImpl extends StackListenerImpl
|
||||
fieldName: name,
|
||||
),
|
||||
fileUri: uri,
|
||||
fileOffset: assignmentOffset,
|
||||
fileOffset: fieldNameOffset,
|
||||
length: noLength,
|
||||
context: [
|
||||
diag.fieldAlreadyInitializedAtDeclarationCause
|
||||
@@ -10026,7 +10024,7 @@ class BodyBuilderImpl extends StackListenerImpl
|
||||
parameterType: formalType,
|
||||
fieldType: builder.fieldType,
|
||||
),
|
||||
fileOffset: assignmentOffset,
|
||||
fileOffset: fieldNameOffset,
|
||||
length: noLength,
|
||||
fileUri: uri,
|
||||
context: [
|
||||
@@ -10042,7 +10040,7 @@ class BodyBuilderImpl extends StackListenerImpl
|
||||
}
|
||||
}
|
||||
return builder.buildInitializer(
|
||||
assignmentOffset,
|
||||
fieldNameOffset,
|
||||
expression,
|
||||
isSynthetic: formal != null,
|
||||
);
|
||||
|
||||
@@ -5846,7 +5846,6 @@ class DelayedAssignment extends ContextAwareGenerator {
|
||||
return _helper.createFieldInitializer(
|
||||
generator._plainNameForRead,
|
||||
offsetForToken(generator.token),
|
||||
fileOffset,
|
||||
value,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -106,7 +106,6 @@ abstract class ExpressionGeneratorHelper {
|
||||
List<Initializer> createFieldInitializer(
|
||||
String name,
|
||||
int fieldNameOffset,
|
||||
int assignmentOffset,
|
||||
Expression expression, {
|
||||
FormalParameterBuilder? formal,
|
||||
});
|
||||
|
||||
@@ -415,6 +415,7 @@ class Resolver {
|
||||
initializers: result.initializers,
|
||||
constantContext: constantContext,
|
||||
internalThisVariable: internalThisVariable,
|
||||
forPrimaryConstructor: false,
|
||||
);
|
||||
context.performBacklog(result.annotations);
|
||||
} on DebugAbort {
|
||||
@@ -437,6 +438,7 @@ class Resolver {
|
||||
required Uri fileUri,
|
||||
required Token beginInitializers,
|
||||
required bool isConst,
|
||||
required bool forPrimaryConstructor,
|
||||
}) {
|
||||
_ResolverContext context = new _ResolverContext(
|
||||
typeInferenceEngine: _typeInferenceEngine,
|
||||
@@ -492,6 +494,7 @@ class Resolver {
|
||||
fileUri: fileUri,
|
||||
constantContext: constantContext,
|
||||
initializers: initializers,
|
||||
forPrimaryConstructor: forPrimaryConstructor,
|
||||
);
|
||||
}
|
||||
context.performBacklog(result.annotations);
|
||||
@@ -683,6 +686,7 @@ class Resolver {
|
||||
initializers: result.initializers,
|
||||
constantContext: constantContext,
|
||||
internalThisVariable: internalThisVariable,
|
||||
forPrimaryConstructor: true,
|
||||
);
|
||||
|
||||
context.performBacklog(result.annotations);
|
||||
@@ -765,6 +769,7 @@ class Resolver {
|
||||
initializers: result.initializers,
|
||||
thisVariable: functionBodyBuildingContext.thisVariable,
|
||||
internalThisVariable: internalThisVariable,
|
||||
forPrimaryConstructor: true,
|
||||
);
|
||||
context.performBacklog(result.annotations);
|
||||
}
|
||||
@@ -1247,6 +1252,7 @@ class Resolver {
|
||||
required Uri fileUri,
|
||||
required ConstantContext constantContext,
|
||||
required List<Initializer> initializers,
|
||||
required bool forPrimaryConstructor,
|
||||
}) {
|
||||
_InitializerBuilder initializerBuilder = new _InitializerBuilder(
|
||||
compilerContext: compilerContext,
|
||||
@@ -1263,6 +1269,7 @@ class Resolver {
|
||||
initializers: initializers,
|
||||
asyncMarker: asyncModifier,
|
||||
asyncModifierFileOffset: body?.fileOffset,
|
||||
forPrimaryConstructor: forPrimaryConstructor,
|
||||
);
|
||||
|
||||
if (body == null && !bodyBuilderContext.isExternalConstructor) {
|
||||
@@ -1281,7 +1288,12 @@ class Resolver {
|
||||
className: bodyBuilderContext.className,
|
||||
),
|
||||
fileUri: fileUri,
|
||||
fileOffset: bodyBuilderContext.memberNameOffset,
|
||||
// It is allowed to have a primary constructor without a body, so
|
||||
// for primary constructors we report the error on the body and not
|
||||
// the name of the constructor.
|
||||
fileOffset: forPrimaryConstructor
|
||||
? body.fileOffset
|
||||
: bodyBuilderContext.memberNameOffset,
|
||||
length: noLength,
|
||||
);
|
||||
}
|
||||
@@ -1301,6 +1313,7 @@ class Resolver {
|
||||
required List<Initializer> initializers,
|
||||
required ConstantContext constantContext,
|
||||
required ThisVariable? internalThisVariable,
|
||||
required bool forPrimaryConstructor,
|
||||
}) {
|
||||
AssignedVariables assignedVariables = context.assignedVariables;
|
||||
|
||||
@@ -1387,6 +1400,7 @@ class Resolver {
|
||||
fileUri: fileUri,
|
||||
constantContext: constantContext,
|
||||
initializers: initializers,
|
||||
forPrimaryConstructor: forPrimaryConstructor,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -229,6 +229,7 @@ class _InitializerBuilder {
|
||||
required List<Initializer> initializers,
|
||||
required AsyncMarker asyncMarker,
|
||||
required int? asyncModifierFileOffset,
|
||||
required bool forPrimaryConstructor,
|
||||
}) {
|
||||
if (initializers.isNotEmpty) {
|
||||
if (_bodyBuilderContext.isMixinClass) {
|
||||
@@ -240,7 +241,12 @@ class _InitializerBuilder {
|
||||
className: _bodyBuilderContext.className,
|
||||
),
|
||||
fileUri: _fileUri,
|
||||
fileOffset: _bodyBuilderContext.memberNameOffset,
|
||||
// It is allowed to have a primary constructor without a body, so
|
||||
// for primary constructors we report the error on the first
|
||||
// initializer and not the name of the constructor.
|
||||
fileOffset: forPrimaryConstructor
|
||||
? initializers.first.fileOffset
|
||||
: _bodyBuilderContext.memberNameOffset,
|
||||
length: noLength,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ library;
|
||||
// E3.named(String it1, String it2) : this(it1), this(it2);
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/extension_types/erroneous_constructors.dart:18:26: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/extension_types/erroneous_constructors.dart:18:23: Error: A redirecting constructor can't have other initializers.
|
||||
// E4.named(bool it) : it = false, this(it);
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
@@ -106,9 +106,9 @@ static extension-type-member synthetic method E4|constructor#_#new#tearOff(core:
|
||||
return self::E4|constructor#(it);
|
||||
static extension-type-member erroneous method E4|constructor#named(core::bool it) → self::E4% /* erasure=core::bool, declared=! */ {
|
||||
lowered final self::E4% /* erasure=core::bool, declared=! */ #this;
|
||||
invalid-expression "pkg/front_end/testcases/extension_types/erroneous_constructors.dart:18:26: Error: A redirecting constructor can't have other initializers.
|
||||
invalid-expression "pkg/front_end/testcases/extension_types/erroneous_constructors.dart:18:23: Error: A redirecting constructor can't have other initializers.
|
||||
E4.named(bool it) : it = false, this(it);
|
||||
^";
|
||||
^";
|
||||
#this = self::E4|constructor#(it);
|
||||
return #this;
|
||||
}
|
||||
|
||||
+4
-4
@@ -19,9 +19,9 @@ library;
|
||||
// E3.named(String it1, String it2) : this(it1), this(it2);
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/extension_types/erroneous_constructors.dart:18:26: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/extension_types/erroneous_constructors.dart:18:23: Error: A redirecting constructor can't have other initializers.
|
||||
// E4.named(bool it) : it = false, this(it);
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
@@ -106,9 +106,9 @@ static extension-type-member synthetic method E4|constructor#_#new#tearOff(core:
|
||||
return self::E4|constructor#(it);
|
||||
static extension-type-member erroneous method E4|constructor#named(core::bool it) → self::E4% /* erasure=core::bool, declared=! */ {
|
||||
lowered final self::E4% /* erasure=core::bool, declared=! */ #this;
|
||||
invalid-expression "pkg/front_end/testcases/extension_types/erroneous_constructors.dart:18:26: Error: A redirecting constructor can't have other initializers.
|
||||
invalid-expression "pkg/front_end/testcases/extension_types/erroneous_constructors.dart:18:23: Error: A redirecting constructor can't have other initializers.
|
||||
E4.named(bool it) : it = false, this(it);
|
||||
^";
|
||||
^";
|
||||
#this = self::E4|constructor#(it);
|
||||
return #this;
|
||||
}
|
||||
|
||||
+4
-4
@@ -19,9 +19,9 @@ library;
|
||||
// E3.named(String it1, String it2) : this(it1), this(it2);
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/extension_types/erroneous_constructors.dart:18:26: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/extension_types/erroneous_constructors.dart:18:23: Error: A redirecting constructor can't have other initializers.
|
||||
// E4.named(bool it) : it = false, this(it);
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
@@ -106,9 +106,9 @@ static extension-type-member synthetic method E4|constructor#_#new#tearOff(core:
|
||||
return self::E4|constructor#(it);
|
||||
static extension-type-member erroneous method E4|constructor#named(core::bool it) → self::E4% /* erasure=core::bool, declared=! */ {
|
||||
lowered final self::E4% /* erasure=core::bool, declared=! */ #this;
|
||||
invalid-expression "pkg/front_end/testcases/extension_types/erroneous_constructors.dart:18:26: Error: A redirecting constructor can't have other initializers.
|
||||
invalid-expression "pkg/front_end/testcases/extension_types/erroneous_constructors.dart:18:23: Error: A redirecting constructor can't have other initializers.
|
||||
E4.named(bool it) : it = false, this(it);
|
||||
^";
|
||||
^";
|
||||
#this = self::E4|constructor#(it);
|
||||
return #this;
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ library;
|
||||
// Class4(this.field, this.nonexisting); // Error
|
||||
// ^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/extension_types/initializers.dart:20:35: Error: 'field' was already initialized by this constructor.
|
||||
// pkg/front_end/testcases/extension_types/initializers.dart:20:29: Error: 'field' was already initialized by this constructor.
|
||||
// Class5(this.field) : this.field = 42; // Error
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/extension_types/initializers.dart:24:29: Error: 'nonexisting' isn't an instance field of this class.
|
||||
// Class6(this.field) : this.nonexisting = 42; // Error
|
||||
@@ -110,9 +110,9 @@ static extension-type-member synthetic method Class5|constructor#_#_#tearOff(cor
|
||||
return self::Class5|constructor#_(field);
|
||||
static extension-type-member method Class5|constructor#(core::int field) → self::Class5% /* erasure=core::int, declared=! */ {
|
||||
lowered final self::Class5% /* erasure=core::int, declared=! */ #this = field;
|
||||
invalid-expression "pkg/front_end/testcases/extension_types/initializers.dart:20:35: Error: 'field' was already initialized by this constructor.
|
||||
invalid-expression "pkg/front_end/testcases/extension_types/initializers.dart:20:29: Error: 'field' was already initialized by this constructor.
|
||||
Class5(this.field) : this.field = 42; // Error
|
||||
^";
|
||||
^";
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method Class5|constructor#_#new#tearOff(core::int field) → self::Class5% /* erasure=core::int, declared=! */
|
||||
|
||||
@@ -6,9 +6,9 @@ library;
|
||||
// Class4(this.field, this.nonexisting); // Error
|
||||
// ^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/extension_types/initializers.dart:20:35: Error: 'field' was already initialized by this constructor.
|
||||
// pkg/front_end/testcases/extension_types/initializers.dart:20:29: Error: 'field' was already initialized by this constructor.
|
||||
// Class5(this.field) : this.field = 42; // Error
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/extension_types/initializers.dart:24:29: Error: 'nonexisting' isn't an instance field of this class.
|
||||
// Class6(this.field) : this.nonexisting = 42; // Error
|
||||
@@ -110,9 +110,9 @@ static extension-type-member synthetic method Class5|constructor#_#_#tearOff(cor
|
||||
return self::Class5|constructor#_(field);
|
||||
static extension-type-member method Class5|constructor#(core::int field) → self::Class5% /* erasure=core::int, declared=! */ {
|
||||
lowered final self::Class5% /* erasure=core::int, declared=! */ #this = field;
|
||||
invalid-expression "pkg/front_end/testcases/extension_types/initializers.dart:20:35: Error: 'field' was already initialized by this constructor.
|
||||
invalid-expression "pkg/front_end/testcases/extension_types/initializers.dart:20:29: Error: 'field' was already initialized by this constructor.
|
||||
Class5(this.field) : this.field = 42; // Error
|
||||
^";
|
||||
^";
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method Class5|constructor#_#new#tearOff(core::int field) → self::Class5% /* erasure=core::int, declared=! */
|
||||
|
||||
@@ -6,9 +6,9 @@ library;
|
||||
// Class4(this.field, this.nonexisting); // Error
|
||||
// ^^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/extension_types/initializers.dart:20:35: Error: 'field' was already initialized by this constructor.
|
||||
// pkg/front_end/testcases/extension_types/initializers.dart:20:29: Error: 'field' was already initialized by this constructor.
|
||||
// Class5(this.field) : this.field = 42; // Error
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/extension_types/initializers.dart:24:29: Error: 'nonexisting' isn't an instance field of this class.
|
||||
// Class6(this.field) : this.nonexisting = 42; // Error
|
||||
@@ -110,9 +110,9 @@ static extension-type-member synthetic method Class5|constructor#_#_#tearOff(cor
|
||||
return self::Class5|constructor#_(field);
|
||||
static extension-type-member method Class5|constructor#(core::int field) → self::Class5% /* erasure=core::int, declared=! */ {
|
||||
lowered final self::Class5% /* erasure=core::int, declared=! */ #this = field;
|
||||
invalid-expression "pkg/front_end/testcases/extension_types/initializers.dart:20:35: Error: 'field' was already initialized by this constructor.
|
||||
invalid-expression "pkg/front_end/testcases/extension_types/initializers.dart:20:29: Error: 'field' was already initialized by this constructor.
|
||||
Class5(this.field) : this.field = 42; // Error
|
||||
^";
|
||||
^";
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method Class5|constructor#_#new#tearOff(core::int field) → self::Class5% /* erasure=core::int, declared=! */
|
||||
|
||||
@@ -2,68 +2,68 @@ library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:9:16: Error: 'x' was already initialized by this constructor.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:9:14: Error: 'x' was already initialized by this constructor.
|
||||
// this.x = 42 {}
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:16:16: Error: 'x' was already initialized by this constructor.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:16:14: Error: 'x' was already initialized by this constructor.
|
||||
// this.x = 42 {}
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:22:16: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:22:14: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
// : this.x = 41,
|
||||
// ^
|
||||
// ^
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:20:13: Context: 'x' was initialized here.
|
||||
// final int x = 2;
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:23:16: Error: 'x' was already initialized by this constructor.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:23:14: Error: 'x' was already initialized by this constructor.
|
||||
// this.x = 42 {}
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:30:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:30:14: Error: A redirecting constructor can't have other initializers.
|
||||
// : this.x = 41,
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:32:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:32:14: Error: A redirecting constructor can't have other initializers.
|
||||
// this.y = 42 {}
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:43:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:43:14: Error: A redirecting constructor can't have other initializers.
|
||||
// this.x = 1,
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:44:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:44:14: Error: A redirecting constructor can't have other initializers.
|
||||
// this.y = 2 {}
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:49:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:49:14: Error: A redirecting constructor can't have other initializers.
|
||||
// : this.x = 1,
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:51:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:51:14: Error: A redirecting constructor can't have other initializers.
|
||||
// this.y = 2;
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:53:9: Error: A redirecting constructor can't have a 'super' initializer.
|
||||
// : super(),
|
||||
// ^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:55:16: Error: Can't have initializers after 'super'.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:55:14: Error: Can't have initializers after 'super'.
|
||||
// this.x = 1,
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:56:16: Error: Can't have initializers after 'super'.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:56:14: Error: Can't have initializers after 'super'.
|
||||
// this.y = 2;
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:58:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:58:14: Error: A redirecting constructor can't have other initializers.
|
||||
// : this.x = 1,
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:59:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:59:14: Error: A redirecting constructor can't have other initializers.
|
||||
// this.y = 2,
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:62:9: Error: A redirecting constructor can't have other initializers.
|
||||
// : assert(true),
|
||||
@@ -93,9 +93,9 @@ library;
|
||||
// super() {}
|
||||
// ^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:101:16: Error: Can't have initializers after 'super'.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:101:14: Error: Can't have initializers after 'super'.
|
||||
// this.x = 42 {}
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
@@ -103,35 +103,35 @@ import "dart:core" as core;
|
||||
class A extends core::Object {
|
||||
field core::int x;
|
||||
constructor •() → self::A
|
||||
: self::A::x = 41, invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:9:16: Error: 'x' was already initialized by this constructor.
|
||||
: self::A::x = 41, invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:9:14: Error: 'x' was already initialized by this constructor.
|
||||
this.x = 42 {}
|
||||
^" {}
|
||||
^" {}
|
||||
}
|
||||
class B extends core::Object {
|
||||
final field core::int x;
|
||||
constructor •() → self::B
|
||||
: self::B::x = 41, invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:16:16: Error: 'x' was already initialized by this constructor.
|
||||
: self::B::x = 41, invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:16:14: Error: 'x' was already initialized by this constructor.
|
||||
this.x = 42 {}
|
||||
^" {}
|
||||
^" {}
|
||||
}
|
||||
class C extends core::Object {
|
||||
final field core::int x = 2;
|
||||
constructor •() → self::C
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:22:16: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:22:14: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
: this.x = 41,
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:23:16: Error: 'x' was already initialized by this constructor.
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:23:14: Error: 'x' was already initialized by this constructor.
|
||||
this.x = 42 {}
|
||||
^" {}
|
||||
^" {}
|
||||
}
|
||||
class D extends core::Object {
|
||||
final field core::int x;
|
||||
final field core::int y;
|
||||
erroneous constructor •() → self::D
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:30:16: Error: A redirecting constructor can't have other initializers.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:30:14: Error: A redirecting constructor can't have other initializers.
|
||||
: this.x = 41,
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:32:16: Error: A redirecting constructor can't have other initializers.
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:32:14: Error: A redirecting constructor can't have other initializers.
|
||||
this.y = 42 {}
|
||||
^", this self::D::named() {}
|
||||
^", this self::D::named() {}
|
||||
constructor named() → self::D
|
||||
: self::D::x = 41, self::D::y = 42, super core::Object::•() {}
|
||||
}
|
||||
@@ -139,35 +139,35 @@ class E extends core::Object {
|
||||
final field core::int x;
|
||||
final field core::int y;
|
||||
erroneous constructor •() → self::E
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:43:16: Error: A redirecting constructor can't have other initializers.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:43:14: Error: A redirecting constructor can't have other initializers.
|
||||
this.x = 1,
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:44:16: Error: A redirecting constructor can't have other initializers.
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:44:14: Error: A redirecting constructor can't have other initializers.
|
||||
this.y = 2 {}
|
||||
^", this self::E::named() {}
|
||||
^", this self::E::named() {}
|
||||
constructor named() → self::E
|
||||
: self::E::x = 41, self::E::y = 42, super core::Object::•() {}
|
||||
erroneous constructor named2() → self::E
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:49:16: Error: A redirecting constructor can't have other initializers.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:49:14: Error: A redirecting constructor can't have other initializers.
|
||||
: this.x = 1,
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:51:16: Error: A redirecting constructor can't have other initializers.
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:51:14: Error: A redirecting constructor can't have other initializers.
|
||||
this.y = 2;
|
||||
^", this self::E::named()
|
||||
^", this self::E::named()
|
||||
;
|
||||
erroneous constructor named3() → self::E
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:53:9: Error: A redirecting constructor can't have a 'super' initializer.
|
||||
: super(),
|
||||
^^^^^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:55:16: Error: Can't have initializers after 'super'.
|
||||
^^^^^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:55:14: Error: Can't have initializers after 'super'.
|
||||
this.x = 1,
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:56:16: Error: Can't have initializers after 'super'.
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:56:14: Error: Can't have initializers after 'super'.
|
||||
this.y = 2;
|
||||
^", super core::Object::•()
|
||||
^", super core::Object::•()
|
||||
;
|
||||
erroneous constructor named4() → self::E
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:58:16: Error: A redirecting constructor can't have other initializers.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:58:14: Error: A redirecting constructor can't have other initializers.
|
||||
: this.x = 1,
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:59:16: Error: A redirecting constructor can't have other initializers.
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:59:14: Error: A redirecting constructor can't have other initializers.
|
||||
this.y = 2,
|
||||
^", this self::E::named()
|
||||
^", this self::E::named()
|
||||
;
|
||||
erroneous constructor named5() → self::E
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:62:9: Error: A redirecting constructor can't have other initializers.
|
||||
@@ -216,8 +216,8 @@ class I extends core::Object {
|
||||
class J extends core::Object {
|
||||
field core::int x;
|
||||
erroneous constructor •() → self::J
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:101:16: Error: Can't have initializers after 'super'.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:101:14: Error: Can't have initializers after 'super'.
|
||||
this.x = 42 {}
|
||||
^", super core::Object::•() {}
|
||||
^", super core::Object::•() {}
|
||||
}
|
||||
static method main() → dynamic {}
|
||||
|
||||
@@ -2,68 +2,68 @@ library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:9:16: Error: 'x' was already initialized by this constructor.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:9:14: Error: 'x' was already initialized by this constructor.
|
||||
// this.x = 42 {}
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:16:16: Error: 'x' was already initialized by this constructor.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:16:14: Error: 'x' was already initialized by this constructor.
|
||||
// this.x = 42 {}
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:22:16: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:22:14: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
// : this.x = 41,
|
||||
// ^
|
||||
// ^
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:20:13: Context: 'x' was initialized here.
|
||||
// final int x = 2;
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:23:16: Error: 'x' was already initialized by this constructor.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:23:14: Error: 'x' was already initialized by this constructor.
|
||||
// this.x = 42 {}
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:30:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:30:14: Error: A redirecting constructor can't have other initializers.
|
||||
// : this.x = 41,
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:32:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:32:14: Error: A redirecting constructor can't have other initializers.
|
||||
// this.y = 42 {}
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:43:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:43:14: Error: A redirecting constructor can't have other initializers.
|
||||
// this.x = 1,
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:44:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:44:14: Error: A redirecting constructor can't have other initializers.
|
||||
// this.y = 2 {}
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:49:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:49:14: Error: A redirecting constructor can't have other initializers.
|
||||
// : this.x = 1,
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:51:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:51:14: Error: A redirecting constructor can't have other initializers.
|
||||
// this.y = 2;
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:53:9: Error: A redirecting constructor can't have a 'super' initializer.
|
||||
// : super(),
|
||||
// ^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:55:16: Error: Can't have initializers after 'super'.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:55:14: Error: Can't have initializers after 'super'.
|
||||
// this.x = 1,
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:56:16: Error: Can't have initializers after 'super'.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:56:14: Error: Can't have initializers after 'super'.
|
||||
// this.y = 2;
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:58:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:58:14: Error: A redirecting constructor can't have other initializers.
|
||||
// : this.x = 1,
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:59:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:59:14: Error: A redirecting constructor can't have other initializers.
|
||||
// this.y = 2,
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:62:9: Error: A redirecting constructor can't have other initializers.
|
||||
// : assert(true),
|
||||
@@ -93,9 +93,9 @@ library;
|
||||
// super() {}
|
||||
// ^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:101:16: Error: Can't have initializers after 'super'.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:101:14: Error: Can't have initializers after 'super'.
|
||||
// this.x = 42 {}
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
@@ -103,35 +103,35 @@ import "dart:core" as core;
|
||||
class A extends core::Object {
|
||||
field core::int x;
|
||||
constructor •() → self::A
|
||||
: self::A::x = 41, invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:9:16: Error: 'x' was already initialized by this constructor.
|
||||
: self::A::x = 41, invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:9:14: Error: 'x' was already initialized by this constructor.
|
||||
this.x = 42 {}
|
||||
^" {}
|
||||
^" {}
|
||||
}
|
||||
class B extends core::Object {
|
||||
final field core::int x;
|
||||
constructor •() → self::B
|
||||
: self::B::x = 41, invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:16:16: Error: 'x' was already initialized by this constructor.
|
||||
: self::B::x = 41, invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:16:14: Error: 'x' was already initialized by this constructor.
|
||||
this.x = 42 {}
|
||||
^" {}
|
||||
^" {}
|
||||
}
|
||||
class C extends core::Object {
|
||||
final field core::int x = 2;
|
||||
constructor •() → self::C
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:22:16: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:22:14: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
: this.x = 41,
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:23:16: Error: 'x' was already initialized by this constructor.
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:23:14: Error: 'x' was already initialized by this constructor.
|
||||
this.x = 42 {}
|
||||
^" {}
|
||||
^" {}
|
||||
}
|
||||
class D extends core::Object {
|
||||
final field core::int x;
|
||||
final field core::int y;
|
||||
erroneous constructor •() → self::D
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:30:16: Error: A redirecting constructor can't have other initializers.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:30:14: Error: A redirecting constructor can't have other initializers.
|
||||
: this.x = 41,
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:32:16: Error: A redirecting constructor can't have other initializers.
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:32:14: Error: A redirecting constructor can't have other initializers.
|
||||
this.y = 42 {}
|
||||
^", this self::D::named() {}
|
||||
^", this self::D::named() {}
|
||||
constructor named() → self::D
|
||||
: self::D::x = 41, self::D::y = 42, super core::Object::•() {}
|
||||
}
|
||||
@@ -139,35 +139,35 @@ class E extends core::Object {
|
||||
final field core::int x;
|
||||
final field core::int y;
|
||||
erroneous constructor •() → self::E
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:43:16: Error: A redirecting constructor can't have other initializers.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:43:14: Error: A redirecting constructor can't have other initializers.
|
||||
this.x = 1,
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:44:16: Error: A redirecting constructor can't have other initializers.
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:44:14: Error: A redirecting constructor can't have other initializers.
|
||||
this.y = 2 {}
|
||||
^", this self::E::named() {}
|
||||
^", this self::E::named() {}
|
||||
constructor named() → self::E
|
||||
: self::E::x = 41, self::E::y = 42, super core::Object::•() {}
|
||||
erroneous constructor named2() → self::E
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:49:16: Error: A redirecting constructor can't have other initializers.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:49:14: Error: A redirecting constructor can't have other initializers.
|
||||
: this.x = 1,
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:51:16: Error: A redirecting constructor can't have other initializers.
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:51:14: Error: A redirecting constructor can't have other initializers.
|
||||
this.y = 2;
|
||||
^", this self::E::named()
|
||||
^", this self::E::named()
|
||||
;
|
||||
erroneous constructor named3() → self::E
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:53:9: Error: A redirecting constructor can't have a 'super' initializer.
|
||||
: super(),
|
||||
^^^^^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:55:16: Error: Can't have initializers after 'super'.
|
||||
^^^^^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:55:14: Error: Can't have initializers after 'super'.
|
||||
this.x = 1,
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:56:16: Error: Can't have initializers after 'super'.
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:56:14: Error: Can't have initializers after 'super'.
|
||||
this.y = 2;
|
||||
^", super core::Object::•()
|
||||
^", super core::Object::•()
|
||||
;
|
||||
erroneous constructor named4() → self::E
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:58:16: Error: A redirecting constructor can't have other initializers.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:58:14: Error: A redirecting constructor can't have other initializers.
|
||||
: this.x = 1,
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:59:16: Error: A redirecting constructor can't have other initializers.
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:59:14: Error: A redirecting constructor can't have other initializers.
|
||||
this.y = 2,
|
||||
^", this self::E::named()
|
||||
^", this self::E::named()
|
||||
;
|
||||
erroneous constructor named5() → self::E
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:62:9: Error: A redirecting constructor can't have other initializers.
|
||||
@@ -216,8 +216,8 @@ class I extends core::Object {
|
||||
class J extends core::Object {
|
||||
field core::int x;
|
||||
erroneous constructor •() → self::J
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:101:16: Error: Can't have initializers after 'super'.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:101:14: Error: Can't have initializers after 'super'.
|
||||
this.x = 42 {}
|
||||
^", super core::Object::•() {}
|
||||
^", super core::Object::•() {}
|
||||
}
|
||||
static method main() → dynamic {}
|
||||
|
||||
+54
-54
@@ -2,68 +2,68 @@ library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:9:16: Error: 'x' was already initialized by this constructor.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:9:14: Error: 'x' was already initialized by this constructor.
|
||||
// this.x = 42 {}
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:16:16: Error: 'x' was already initialized by this constructor.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:16:14: Error: 'x' was already initialized by this constructor.
|
||||
// this.x = 42 {}
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:22:16: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:22:14: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
// : this.x = 41,
|
||||
// ^
|
||||
// ^
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:20:13: Context: 'x' was initialized here.
|
||||
// final int x = 2;
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:23:16: Error: 'x' was already initialized by this constructor.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:23:14: Error: 'x' was already initialized by this constructor.
|
||||
// this.x = 42 {}
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:30:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:30:14: Error: A redirecting constructor can't have other initializers.
|
||||
// : this.x = 41,
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:32:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:32:14: Error: A redirecting constructor can't have other initializers.
|
||||
// this.y = 42 {}
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:43:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:43:14: Error: A redirecting constructor can't have other initializers.
|
||||
// this.x = 1,
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:44:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:44:14: Error: A redirecting constructor can't have other initializers.
|
||||
// this.y = 2 {}
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:49:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:49:14: Error: A redirecting constructor can't have other initializers.
|
||||
// : this.x = 1,
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:51:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:51:14: Error: A redirecting constructor can't have other initializers.
|
||||
// this.y = 2;
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:53:9: Error: A redirecting constructor can't have a 'super' initializer.
|
||||
// : super(),
|
||||
// ^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:55:16: Error: Can't have initializers after 'super'.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:55:14: Error: Can't have initializers after 'super'.
|
||||
// this.x = 1,
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:56:16: Error: Can't have initializers after 'super'.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:56:14: Error: Can't have initializers after 'super'.
|
||||
// this.y = 2;
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:58:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:58:14: Error: A redirecting constructor can't have other initializers.
|
||||
// : this.x = 1,
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:59:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:59:14: Error: A redirecting constructor can't have other initializers.
|
||||
// this.y = 2,
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:62:9: Error: A redirecting constructor can't have other initializers.
|
||||
// : assert(true),
|
||||
@@ -93,9 +93,9 @@ library;
|
||||
// super() {}
|
||||
// ^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:101:16: Error: Can't have initializers after 'super'.
|
||||
// pkg/front_end/testcases/general/initialization_errors.dart:101:14: Error: Can't have initializers after 'super'.
|
||||
// this.x = 42 {}
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
@@ -103,35 +103,35 @@ import "dart:core" as core;
|
||||
class A extends core::Object {
|
||||
field core::int x;
|
||||
constructor •() → self::A
|
||||
: self::A::x = 41, invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:9:16: Error: 'x' was already initialized by this constructor.
|
||||
: self::A::x = 41, invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:9:14: Error: 'x' was already initialized by this constructor.
|
||||
this.x = 42 {}
|
||||
^" {}
|
||||
^" {}
|
||||
}
|
||||
class B extends core::Object {
|
||||
final field core::int x;
|
||||
constructor •() → self::B
|
||||
: self::B::x = 41, invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:16:16: Error: 'x' was already initialized by this constructor.
|
||||
: self::B::x = 41, invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:16:14: Error: 'x' was already initialized by this constructor.
|
||||
this.x = 42 {}
|
||||
^" {}
|
||||
^" {}
|
||||
}
|
||||
class C extends core::Object {
|
||||
final field core::int x = 2;
|
||||
constructor •() → self::C
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:22:16: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:22:14: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
: this.x = 41,
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:23:16: Error: 'x' was already initialized by this constructor.
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:23:14: Error: 'x' was already initialized by this constructor.
|
||||
this.x = 42 {}
|
||||
^" {}
|
||||
^" {}
|
||||
}
|
||||
class D extends core::Object {
|
||||
final field core::int x;
|
||||
final field core::int y;
|
||||
erroneous constructor •() → self::D
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:30:16: Error: A redirecting constructor can't have other initializers.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:30:14: Error: A redirecting constructor can't have other initializers.
|
||||
: this.x = 41,
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:32:16: Error: A redirecting constructor can't have other initializers.
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:32:14: Error: A redirecting constructor can't have other initializers.
|
||||
this.y = 42 {}
|
||||
^", this self::D::named() {}
|
||||
^", this self::D::named() {}
|
||||
constructor named() → self::D
|
||||
: self::D::x = 41, self::D::y = 42, super core::Object::•() {}
|
||||
}
|
||||
@@ -139,35 +139,35 @@ class E extends core::Object {
|
||||
final field core::int x;
|
||||
final field core::int y;
|
||||
erroneous constructor •() → self::E
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:43:16: Error: A redirecting constructor can't have other initializers.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:43:14: Error: A redirecting constructor can't have other initializers.
|
||||
this.x = 1,
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:44:16: Error: A redirecting constructor can't have other initializers.
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:44:14: Error: A redirecting constructor can't have other initializers.
|
||||
this.y = 2 {}
|
||||
^", this self::E::named() {}
|
||||
^", this self::E::named() {}
|
||||
constructor named() → self::E
|
||||
: self::E::x = 41, self::E::y = 42, super core::Object::•() {}
|
||||
erroneous constructor named2() → self::E
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:49:16: Error: A redirecting constructor can't have other initializers.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:49:14: Error: A redirecting constructor can't have other initializers.
|
||||
: this.x = 1,
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:51:16: Error: A redirecting constructor can't have other initializers.
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:51:14: Error: A redirecting constructor can't have other initializers.
|
||||
this.y = 2;
|
||||
^", this self::E::named()
|
||||
^", this self::E::named()
|
||||
;
|
||||
erroneous constructor named3() → self::E
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:53:9: Error: A redirecting constructor can't have a 'super' initializer.
|
||||
: super(),
|
||||
^^^^^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:55:16: Error: Can't have initializers after 'super'.
|
||||
^^^^^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:55:14: Error: Can't have initializers after 'super'.
|
||||
this.x = 1,
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:56:16: Error: Can't have initializers after 'super'.
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:56:14: Error: Can't have initializers after 'super'.
|
||||
this.y = 2;
|
||||
^", super core::Object::•()
|
||||
^", super core::Object::•()
|
||||
;
|
||||
erroneous constructor named4() → self::E
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:58:16: Error: A redirecting constructor can't have other initializers.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:58:14: Error: A redirecting constructor can't have other initializers.
|
||||
: this.x = 1,
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:59:16: Error: A redirecting constructor can't have other initializers.
|
||||
^", invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:59:14: Error: A redirecting constructor can't have other initializers.
|
||||
this.y = 2,
|
||||
^", this self::E::named()
|
||||
^", this self::E::named()
|
||||
;
|
||||
erroneous constructor named5() → self::E
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:62:9: Error: A redirecting constructor can't have other initializers.
|
||||
@@ -216,8 +216,8 @@ class I extends core::Object {
|
||||
class J extends core::Object {
|
||||
field core::int x;
|
||||
erroneous constructor •() → self::J
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:101:16: Error: Can't have initializers after 'super'.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/initialization_errors.dart:101:14: Error: Can't have initializers after 'super'.
|
||||
this.x = 42 {}
|
||||
^", super core::Object::•() {}
|
||||
^", super core::Object::•() {}
|
||||
}
|
||||
static method main() → dynamic {}
|
||||
|
||||
@@ -38,9 +38,9 @@ library;
|
||||
// this.y = 2;
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/issue43363.dart:9:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/issue43363.dart:9:14: Error: A redirecting constructor can't have other initializers.
|
||||
// this.x = 1;
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/issue43363.dart:10:16: Error: Expected a function body or '=>'.
|
||||
// Try adding {}.
|
||||
@@ -81,9 +81,9 @@ Try removing the return type.
|
||||
this.y = 2;
|
||||
^";
|
||||
erroneous constructor •() → self::E
|
||||
: invalid-initializer "pkg/front_end/testcases/general/issue43363.dart:9:16: Error: A redirecting constructor can't have other initializers.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/issue43363.dart:9:14: Error: A redirecting constructor can't have other initializers.
|
||||
this.x = 1;
|
||||
^", this self::E::named()
|
||||
^", this self::E::named()
|
||||
;
|
||||
constructor named() → self::E
|
||||
: self::E::x = 5, self::E::y = 6, super core::Object::•()
|
||||
|
||||
@@ -38,9 +38,9 @@ library;
|
||||
// this.y = 2;
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/issue43363.dart:9:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/issue43363.dart:9:14: Error: A redirecting constructor can't have other initializers.
|
||||
// this.x = 1;
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/issue43363.dart:10:16: Error: Expected a function body or '=>'.
|
||||
// Try adding {}.
|
||||
@@ -81,9 +81,9 @@ Try removing the return type.
|
||||
this.y = 2;
|
||||
^";
|
||||
erroneous constructor •() → self::E
|
||||
: invalid-initializer "pkg/front_end/testcases/general/issue43363.dart:9:16: Error: A redirecting constructor can't have other initializers.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/issue43363.dart:9:14: Error: A redirecting constructor can't have other initializers.
|
||||
this.x = 1;
|
||||
^", this self::E::named()
|
||||
^", this self::E::named()
|
||||
;
|
||||
constructor named() → self::E
|
||||
: self::E::x = 5, self::E::y = 6, super core::Object::•()
|
||||
|
||||
@@ -38,9 +38,9 @@ library;
|
||||
// this.y = 2;
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/issue43363.dart:9:16: Error: A redirecting constructor can't have other initializers.
|
||||
// pkg/front_end/testcases/general/issue43363.dart:9:14: Error: A redirecting constructor can't have other initializers.
|
||||
// this.x = 1;
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/issue43363.dart:10:16: Error: Expected a function body or '=>'.
|
||||
// Try adding {}.
|
||||
@@ -81,9 +81,9 @@ Try removing the return type.
|
||||
this.y = 2;
|
||||
^";
|
||||
erroneous constructor •() → self::E
|
||||
: invalid-initializer "pkg/front_end/testcases/general/issue43363.dart:9:16: Error: A redirecting constructor can't have other initializers.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/issue43363.dart:9:14: Error: A redirecting constructor can't have other initializers.
|
||||
this.x = 1;
|
||||
^", this self::E::named()
|
||||
^", this self::E::named()
|
||||
;
|
||||
constructor named() → self::E
|
||||
: self::E::x = 5, self::E::y = 6, super core::Object::•()
|
||||
|
||||
@@ -15,16 +15,16 @@ library;
|
||||
// const A.named2() : x = new Object();
|
||||
// ^^^
|
||||
//
|
||||
// pkg/front_end/testcases/general/many_errors.dart:10:24: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
// pkg/front_end/testcases/general/many_errors.dart:10:22: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
// const A.named2() : x = new Object();
|
||||
// ^
|
||||
// ^
|
||||
// pkg/front_end/testcases/general/many_errors.dart:6:9: Context: 'x' was initialized here.
|
||||
// final x = null;
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/many_errors.dart:12:24: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
// pkg/front_end/testcases/general/many_errors.dart:12:22: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
// const A.named3() : x = const Object();
|
||||
// ^
|
||||
// ^
|
||||
// pkg/front_end/testcases/general/many_errors.dart:6:9: Context: 'x' was initialized here.
|
||||
// final x = null;
|
||||
// ^
|
||||
@@ -57,14 +57,14 @@ class A extends core::Object /*hasConstConstructor*/ {
|
||||
const A.named1() sync* {}
|
||||
^" {}
|
||||
const constructor named2() → self::A
|
||||
: invalid-initializer "pkg/front_end/testcases/general/many_errors.dart:10:24: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/many_errors.dart:10:22: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
const A.named2() : x = new Object();
|
||||
^"
|
||||
^"
|
||||
;
|
||||
const constructor named3() → self::A
|
||||
: invalid-initializer "pkg/front_end/testcases/general/many_errors.dart:12:24: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/many_errors.dart:12:22: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
const A.named3() : x = const Object();
|
||||
^"
|
||||
^"
|
||||
;
|
||||
}
|
||||
class B extends core::Object {
|
||||
|
||||
@@ -15,16 +15,16 @@ library;
|
||||
// const A.named2() : x = new Object();
|
||||
// ^^^
|
||||
//
|
||||
// pkg/front_end/testcases/general/many_errors.dart:10:24: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
// pkg/front_end/testcases/general/many_errors.dart:10:22: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
// const A.named2() : x = new Object();
|
||||
// ^
|
||||
// ^
|
||||
// pkg/front_end/testcases/general/many_errors.dart:6:9: Context: 'x' was initialized here.
|
||||
// final x = null;
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/many_errors.dart:12:24: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
// pkg/front_end/testcases/general/many_errors.dart:12:22: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
// const A.named3() : x = const Object();
|
||||
// ^
|
||||
// ^
|
||||
// pkg/front_end/testcases/general/many_errors.dart:6:9: Context: 'x' was initialized here.
|
||||
// final x = null;
|
||||
// ^
|
||||
@@ -57,14 +57,14 @@ class A extends core::Object /*hasConstConstructor*/ {
|
||||
const A.named1() sync* {}
|
||||
^" {}
|
||||
const constructor named2() → self::A
|
||||
: invalid-initializer "pkg/front_end/testcases/general/many_errors.dart:10:24: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/many_errors.dart:10:22: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
const A.named2() : x = new Object();
|
||||
^"
|
||||
^"
|
||||
;
|
||||
const constructor named3() → self::A
|
||||
: invalid-initializer "pkg/front_end/testcases/general/many_errors.dart:12:24: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/many_errors.dart:12:22: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
const A.named3() : x = const Object();
|
||||
^"
|
||||
^"
|
||||
;
|
||||
}
|
||||
class B extends core::Object {
|
||||
|
||||
@@ -15,16 +15,16 @@ library;
|
||||
// const A.named2() : x = new Object();
|
||||
// ^^^
|
||||
//
|
||||
// pkg/front_end/testcases/general/many_errors.dart:10:24: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
// pkg/front_end/testcases/general/many_errors.dart:10:22: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
// const A.named2() : x = new Object();
|
||||
// ^
|
||||
// ^
|
||||
// pkg/front_end/testcases/general/many_errors.dart:6:9: Context: 'x' was initialized here.
|
||||
// final x = null;
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/many_errors.dart:12:24: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
// pkg/front_end/testcases/general/many_errors.dart:12:22: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
// const A.named3() : x = const Object();
|
||||
// ^
|
||||
// ^
|
||||
// pkg/front_end/testcases/general/many_errors.dart:6:9: Context: 'x' was initialized here.
|
||||
// final x = null;
|
||||
// ^
|
||||
@@ -37,14 +37,14 @@ class A extends core::Object /*hasConstConstructor*/ {
|
||||
constructor named1() → self::A
|
||||
;
|
||||
const constructor named2() → self::A
|
||||
: invalid-initializer "pkg/front_end/testcases/general/many_errors.dart:10:24: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/many_errors.dart:10:22: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
const A.named2() : x = new Object();
|
||||
^"
|
||||
^"
|
||||
;
|
||||
const constructor named3() → self::A
|
||||
: invalid-initializer "pkg/front_end/testcases/general/many_errors.dart:12:24: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/many_errors.dart:12:22: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
const A.named3() : x = const Object();
|
||||
^"
|
||||
^"
|
||||
;
|
||||
}
|
||||
class B extends core::Object {
|
||||
|
||||
@@ -15,16 +15,16 @@ library;
|
||||
// const A.named2() : x = new Object();
|
||||
// ^^^
|
||||
//
|
||||
// pkg/front_end/testcases/general/many_errors.dart:10:24: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
// pkg/front_end/testcases/general/many_errors.dart:10:22: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
// const A.named2() : x = new Object();
|
||||
// ^
|
||||
// ^
|
||||
// pkg/front_end/testcases/general/many_errors.dart:6:9: Context: 'x' was initialized here.
|
||||
// final x = null;
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/many_errors.dart:12:24: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
// pkg/front_end/testcases/general/many_errors.dart:12:22: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
// const A.named3() : x = const Object();
|
||||
// ^
|
||||
// ^
|
||||
// pkg/front_end/testcases/general/many_errors.dart:6:9: Context: 'x' was initialized here.
|
||||
// final x = null;
|
||||
// ^
|
||||
@@ -57,14 +57,14 @@ class A extends core::Object /*hasConstConstructor*/ {
|
||||
const A.named1() sync* {}
|
||||
^" {}
|
||||
const constructor named2() → self::A
|
||||
: invalid-initializer "pkg/front_end/testcases/general/many_errors.dart:10:24: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/many_errors.dart:10:22: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
const A.named2() : x = new Object();
|
||||
^"
|
||||
^"
|
||||
;
|
||||
const constructor named3() → self::A
|
||||
: invalid-initializer "pkg/front_end/testcases/general/many_errors.dart:12:24: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
: invalid-initializer "pkg/front_end/testcases/general/many_errors.dart:12:22: Error: 'x' is a final instance variable that was initialized at the declaration.
|
||||
const A.named3() : x = const Object();
|
||||
^"
|
||||
^"
|
||||
;
|
||||
}
|
||||
class B extends core::Object {
|
||||
|
||||
@@ -2,13 +2,13 @@ library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/mixin_class.dart:5:15: Error: Can't use 'M1' as a mixin because it has constructors.
|
||||
// mixin class M1() {
|
||||
// ^
|
||||
// pkg/front_end/testcases/primary_constructors/mixin_class.dart:6:8: Error: Can't use 'M1' as a mixin because it has constructors.
|
||||
// this {}
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/mixin_class.dart:9:15: Error: Can't use 'M2' as a mixin because it has constructors.
|
||||
// mixin class M2() {
|
||||
// ^
|
||||
// pkg/front_end/testcases/primary_constructors/mixin_class.dart:11:9: Error: Can't use 'M2' as a mixin because it has constructors.
|
||||
// this: v = 0;
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
@@ -2,13 +2,13 @@ library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/mixin_class.dart:5:15: Error: Can't use 'M1' as a mixin because it has constructors.
|
||||
// mixin class M1() {
|
||||
// ^
|
||||
// pkg/front_end/testcases/primary_constructors/mixin_class.dart:6:8: Error: Can't use 'M1' as a mixin because it has constructors.
|
||||
// this {}
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/mixin_class.dart:9:15: Error: Can't use 'M2' as a mixin because it has constructors.
|
||||
// mixin class M2() {
|
||||
// ^
|
||||
// pkg/front_end/testcases/primary_constructors/mixin_class.dart:11:9: Error: Can't use 'M2' as a mixin because it has constructors.
|
||||
// this: v = 0;
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
+6
-6
@@ -2,13 +2,13 @@ library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/mixin_class.dart:5:15: Error: Can't use 'M1' as a mixin because it has constructors.
|
||||
// mixin class M1() {
|
||||
// ^
|
||||
// pkg/front_end/testcases/primary_constructors/mixin_class.dart:6:8: Error: Can't use 'M1' as a mixin because it has constructors.
|
||||
// this {}
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/mixin_class.dart:9:15: Error: Can't use 'M2' as a mixin because it has constructors.
|
||||
// mixin class M2() {
|
||||
// ^
|
||||
// pkg/front_end/testcases/primary_constructors/mixin_class.dart:11:9: Error: Can't use 'M2' as a mixin because it has constructors.
|
||||
// this: v = 0;
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
@@ -2,17 +2,17 @@ library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/rasta/super_initializer.dart:15:15: Error: Can't have initializers after 'super'.
|
||||
// pkg/front_end/testcases/rasta/super_initializer.dart:15:9: Error: Can't have initializers after 'super'.
|
||||
// field = 42;
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/rasta/super_initializer.dart:18:15: Error: Can't have initializers after 'super'.
|
||||
// pkg/front_end/testcases/rasta/super_initializer.dart:18:9: Error: Can't have initializers after 'super'.
|
||||
// field = 42;
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/rasta/super_initializer.dart:21:15: Error: Can't have initializers after 'super'.
|
||||
// pkg/front_end/testcases/rasta/super_initializer.dart:21:9: Error: Can't have initializers after 'super'.
|
||||
// field = 42;
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
@@ -31,18 +31,18 @@ class Super extends core::Object {
|
||||
class Sub extends self::Super {
|
||||
field dynamic field;
|
||||
erroneous constructor arg0() → self::Sub
|
||||
: invalid-initializer "pkg/front_end/testcases/rasta/super_initializer.dart:15:15: Error: Can't have initializers after 'super'.
|
||||
: invalid-initializer "pkg/front_end/testcases/rasta/super_initializer.dart:15:9: Error: Can't have initializers after 'super'.
|
||||
field = 42;
|
||||
^", super self::Super::arg0()
|
||||
^", super self::Super::arg0()
|
||||
;
|
||||
erroneous constructor arg1(dynamic a) → self::Sub
|
||||
: invalid-initializer "pkg/front_end/testcases/rasta/super_initializer.dart:18:15: Error: Can't have initializers after 'super'.
|
||||
: invalid-initializer "pkg/front_end/testcases/rasta/super_initializer.dart:18:9: Error: Can't have initializers after 'super'.
|
||||
field = 42;
|
||||
^", super self::Super::arg1(a)
|
||||
^", super self::Super::arg1(a)
|
||||
;
|
||||
erroneous constructor arg2(dynamic a, dynamic b) → self::Sub
|
||||
: invalid-initializer "pkg/front_end/testcases/rasta/super_initializer.dart:21:15: Error: Can't have initializers after 'super'.
|
||||
: invalid-initializer "pkg/front_end/testcases/rasta/super_initializer.dart:21:9: Error: Can't have initializers after 'super'.
|
||||
field = 42;
|
||||
^", super self::Super::arg2(a, b)
|
||||
^", super self::Super::arg2(a, b)
|
||||
;
|
||||
}
|
||||
|
||||
@@ -2,17 +2,17 @@ library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/rasta/super_initializer.dart:15:15: Error: Can't have initializers after 'super'.
|
||||
// pkg/front_end/testcases/rasta/super_initializer.dart:15:9: Error: Can't have initializers after 'super'.
|
||||
// field = 42;
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/rasta/super_initializer.dart:18:15: Error: Can't have initializers after 'super'.
|
||||
// pkg/front_end/testcases/rasta/super_initializer.dart:18:9: Error: Can't have initializers after 'super'.
|
||||
// field = 42;
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/rasta/super_initializer.dart:21:15: Error: Can't have initializers after 'super'.
|
||||
// pkg/front_end/testcases/rasta/super_initializer.dart:21:9: Error: Can't have initializers after 'super'.
|
||||
// field = 42;
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
@@ -31,18 +31,18 @@ class Super extends core::Object {
|
||||
class Sub extends self::Super {
|
||||
field dynamic field;
|
||||
erroneous constructor arg0() → self::Sub
|
||||
: invalid-initializer "pkg/front_end/testcases/rasta/super_initializer.dart:15:15: Error: Can't have initializers after 'super'.
|
||||
: invalid-initializer "pkg/front_end/testcases/rasta/super_initializer.dart:15:9: Error: Can't have initializers after 'super'.
|
||||
field = 42;
|
||||
^", super self::Super::arg0()
|
||||
^", super self::Super::arg0()
|
||||
;
|
||||
erroneous constructor arg1(dynamic a) → self::Sub
|
||||
: invalid-initializer "pkg/front_end/testcases/rasta/super_initializer.dart:18:15: Error: Can't have initializers after 'super'.
|
||||
: invalid-initializer "pkg/front_end/testcases/rasta/super_initializer.dart:18:9: Error: Can't have initializers after 'super'.
|
||||
field = 42;
|
||||
^", super self::Super::arg1(a)
|
||||
^", super self::Super::arg1(a)
|
||||
;
|
||||
erroneous constructor arg2(dynamic a, dynamic b) → self::Sub
|
||||
: invalid-initializer "pkg/front_end/testcases/rasta/super_initializer.dart:21:15: Error: Can't have initializers after 'super'.
|
||||
: invalid-initializer "pkg/front_end/testcases/rasta/super_initializer.dart:21:9: Error: Can't have initializers after 'super'.
|
||||
field = 42;
|
||||
^", super self::Super::arg2(a, b)
|
||||
^", super self::Super::arg2(a, b)
|
||||
;
|
||||
}
|
||||
|
||||
@@ -2,17 +2,17 @@ library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/rasta/super_initializer.dart:15:15: Error: Can't have initializers after 'super'.
|
||||
// pkg/front_end/testcases/rasta/super_initializer.dart:15:9: Error: Can't have initializers after 'super'.
|
||||
// field = 42;
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/rasta/super_initializer.dart:18:15: Error: Can't have initializers after 'super'.
|
||||
// pkg/front_end/testcases/rasta/super_initializer.dart:18:9: Error: Can't have initializers after 'super'.
|
||||
// field = 42;
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/rasta/super_initializer.dart:21:15: Error: Can't have initializers after 'super'.
|
||||
// pkg/front_end/testcases/rasta/super_initializer.dart:21:9: Error: Can't have initializers after 'super'.
|
||||
// field = 42;
|
||||
// ^
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
@@ -31,18 +31,18 @@ class Super extends core::Object {
|
||||
class Sub extends self::Super {
|
||||
field dynamic field;
|
||||
erroneous constructor arg0() → self::Sub
|
||||
: invalid-initializer "pkg/front_end/testcases/rasta/super_initializer.dart:15:15: Error: Can't have initializers after 'super'.
|
||||
: invalid-initializer "pkg/front_end/testcases/rasta/super_initializer.dart:15:9: Error: Can't have initializers after 'super'.
|
||||
field = 42;
|
||||
^", super self::Super::arg0()
|
||||
^", super self::Super::arg0()
|
||||
;
|
||||
erroneous constructor arg1(dynamic a) → self::Sub
|
||||
: invalid-initializer "pkg/front_end/testcases/rasta/super_initializer.dart:18:15: Error: Can't have initializers after 'super'.
|
||||
: invalid-initializer "pkg/front_end/testcases/rasta/super_initializer.dart:18:9: Error: Can't have initializers after 'super'.
|
||||
field = 42;
|
||||
^", super self::Super::arg1(a)
|
||||
^", super self::Super::arg1(a)
|
||||
;
|
||||
erroneous constructor arg2(dynamic a, dynamic b) → self::Sub
|
||||
: invalid-initializer "pkg/front_end/testcases/rasta/super_initializer.dart:21:15: Error: Can't have initializers after 'super'.
|
||||
: invalid-initializer "pkg/front_end/testcases/rasta/super_initializer.dart:21:9: Error: Can't have initializers after 'super'.
|
||||
field = 42;
|
||||
^", super self::Super::arg2(a, b)
|
||||
^", super self::Super::arg2(a, b)
|
||||
;
|
||||
}
|
||||
|
||||
@@ -603,9 +603,9 @@ class TestStruct3 extends TestStruct {}
|
||||
// ^^^^^^^^^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_BASE_OR_FINAL_IS_NOT_BASE_FINAL_OR_SEALED
|
||||
// [cfe] Class 'TestStruct' cannot be extended or implemented.
|
||||
// [cfe] Deeply immutable classes must be final or sealed.
|
||||
// [cfe] TestStruct 'TestStruct3' is empty. Empty structs and unions are undefined behavior.
|
||||
// [cfe] The type 'TestStruct3' must be 'base', 'final' or 'sealed' because the supertype 'TestStruct' is 'final'.
|
||||
// [cfe] Deeply immutable classes must be final or sealed.
|
||||
// ^^^^^^^^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_STRUCT_CLASS
|
||||
|
||||
@@ -671,8 +671,8 @@ final class TestStruct8 extends Struct {
|
||||
double z = 10.0;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.FIELD_MUST_BE_EXTERNAL_IN_STRUCT
|
||||
// [cfe] Field 'z' is a dart:ffi Pointer to a struct field and therefore cannot be initialized before constructor execution.
|
||||
// [cfe] Deeply immutable classes must only have final non-late instance fields.
|
||||
// [cfe] Field 'z' is a dart:ffi Pointer to a struct field and therefore cannot be initialized before constructor execution.
|
||||
|
||||
external Pointer notEmpty;
|
||||
}
|
||||
@@ -683,13 +683,13 @@ final class TestStruct9 extends Struct {
|
||||
double z;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.FIELD_MUST_BE_EXTERNAL_IN_STRUCT
|
||||
// [cfe] Field 'z' is a dart:ffi Pointer to a struct field and therefore cannot be initialized before constructor execution.
|
||||
// [cfe] Deeply immutable classes must only have final non-late instance fields.
|
||||
// [cfe] Field 'z' is a dart:ffi Pointer to a struct field and therefore cannot be initialized before constructor execution.
|
||||
|
||||
external Pointer notEmpty;
|
||||
|
||||
TestStruct9() : z = 0.0 {}
|
||||
// ^
|
||||
// ^
|
||||
// [cfe] Field 'z' is a dart:ffi Pointer to a struct field and therefore cannot be initialized before constructor execution.
|
||||
}
|
||||
|
||||
@@ -902,8 +902,8 @@ class IStruct implements Struct {}
|
||||
// ^^^^^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_BASE_OR_FINAL_IS_NOT_BASE_FINAL_OR_SEALED
|
||||
// [cfe] Class 'Object' cannot be extended or implemented.
|
||||
// [cfe] The type 'IStruct' must be 'base', 'final' or 'sealed' because the supertype 'Struct' is 'base'.
|
||||
// [cfe] Subtypes of deeply immutable classes must be deeply immutable.
|
||||
// [cfe] The type 'IStruct' must be 'base', 'final' or 'sealed' because the supertype 'Struct' is 'base'.
|
||||
// ^^^^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
|
||||
// [cfe] The class 'Struct' can't be implemented outside of its library because it's a base class.
|
||||
|
||||
@@ -48,7 +48,6 @@ class C3 {
|
||||
const C3() : field = new C0()
|
||||
// ^^^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION
|
||||
// ^
|
||||
// [cfe] 'field' is a final instance variable that was initialized at the declaration.
|
||||
// ^^^^^^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.INVALID_CONSTANT
|
||||
|
||||
@@ -118,7 +118,6 @@ class C1 {
|
||||
: x = C0.X
|
||||
//^
|
||||
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION
|
||||
// ^
|
||||
// [cfe] 'x' is a final instance variable that was initialized at the declaration.
|
||||
;
|
||||
final x = null;
|
||||
|
||||
@@ -10,7 +10,6 @@ class Class {
|
||||
field_ = 2;
|
||||
// ^^^^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS
|
||||
// ^
|
||||
// [cfe] 'field_' was already initialized by this constructor.
|
||||
|
||||
Class.field(this.field_)
|
||||
@@ -19,7 +18,6 @@ class Class {
|
||||
: field_ = 2;
|
||||
// ^^^^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER
|
||||
// ^
|
||||
// [cfe] 'field_' was already initialized by this constructor.
|
||||
|
||||
// Test against duplicate final field initialization in initializing formals.
|
||||
|
||||
@@ -17,7 +17,6 @@ class A {
|
||||
A.illegalInit() : this(3), x = 5;
|
||||
// ^^^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR
|
||||
// ^
|
||||
// [cfe] A redirecting constructor can't have other initializers.
|
||||
|
||||
// Redirecting constructor must not have initializing formal parameters.
|
||||
|
||||
@@ -15,7 +15,6 @@ class CoffeeShop {
|
||||
CoffeeShop.name(String shopName) : this.shopName = shopName;
|
||||
// ^^^^^^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION
|
||||
// ^
|
||||
// [cfe] 'shopName' is a final instance variable that was initialized at the declaration.
|
||||
}
|
||||
|
||||
|
||||
@@ -27,14 +27,14 @@ class C extends S {
|
||||
//^^^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
|
||||
x = x;
|
||||
// ^
|
||||
// ^
|
||||
// [cfe] Can't have initializers after 'super'.
|
||||
C.cc10(int x)
|
||||
: super.named(),
|
||||
//^^^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
|
||||
x = x;
|
||||
// ^
|
||||
// ^
|
||||
// [cfe] Can't have initializers after 'super'.
|
||||
C.cc11(this.x)
|
||||
: super(),
|
||||
@@ -55,7 +55,7 @@ class C extends S {
|
||||
//^^^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
|
||||
x = x,
|
||||
//^
|
||||
// [error column 7]
|
||||
// [cfe] Can't have initializers after 'super'.
|
||||
assert(x == x);
|
||||
// ^
|
||||
@@ -65,7 +65,7 @@ class C extends S {
|
||||
//^^^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
|
||||
x = x,
|
||||
//^
|
||||
// [error column 7]
|
||||
// [cfe] Can't have initializers after 'super'.
|
||||
assert(x == x);
|
||||
// ^
|
||||
@@ -100,14 +100,14 @@ class C extends S {
|
||||
//^^^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
|
||||
x = x;
|
||||
// ^
|
||||
// ^
|
||||
// [cfe] Can't have initializers after 'super'.
|
||||
const C.cc26(int x)
|
||||
: super.named(),
|
||||
//^^^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
|
||||
x = x;
|
||||
// ^
|
||||
// ^
|
||||
// [cfe] Can't have initializers after 'super'.
|
||||
const C.cc27(this.x)
|
||||
: super(),
|
||||
@@ -128,7 +128,7 @@ class C extends S {
|
||||
//^^^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
|
||||
x = x,
|
||||
//^
|
||||
// [error column 7]
|
||||
// [cfe] Can't have initializers after 'super'.
|
||||
assert(x == x);
|
||||
// ^
|
||||
@@ -138,7 +138,7 @@ class C extends S {
|
||||
//^^^^^
|
||||
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
|
||||
x = x,
|
||||
//^
|
||||
// [error column 7]
|
||||
// [cfe] Can't have initializers after 'super'.
|
||||
assert(x == x);
|
||||
// ^
|
||||
|
||||
Reference in New Issue
Block a user