25513e6f07
+ evaluate inline class annotations Change-Id: Ia5a17b4ecf2fc273e347374c9ad7713301103c96 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280101 Reviewed-by: Srujan Gaddam <srujzs@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com>
86 lines
3.5 KiB
Plaintext
86 lines
3.5 KiB
Plaintext
library /*isNonNullableByDefault*/;
|
|
//
|
|
// Problems in library:
|
|
//
|
|
// pkg/front_end/testcases/inline_class/initializers.dart:24:27: Error: 'nonexisting' isn't an instance field of this class.
|
|
// Class4(this.field, this.nonexisting);
|
|
// ^^^^^^^^^^^
|
|
//
|
|
// pkg/front_end/testcases/inline_class/initializers.dart:30:35: Error: 'field' was already initialized by this constructor.
|
|
// Class5(this.field) : this.field = 42;
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/inline_class/initializers.dart:36:29: Error: 'nonexisting' isn't an instance field of this class.
|
|
// Class6(this.field) : this.nonexisting = 42;
|
|
// ^^^^^^^^^^^
|
|
//
|
|
// pkg/front_end/testcases/inline_class/initializers.dart:18:13: Error: Final field 'field' is not initialized.
|
|
// Try to initialize the field in the declaration or in every constructor.
|
|
// final int field;
|
|
// ^^^^^
|
|
//
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
inline class Class1 /* declaredRepresentationType = core::int */ {
|
|
constructor • = self::Class1|;
|
|
tearoff • = self::Class1|get#;
|
|
}
|
|
inline class Class2 /* declaredRepresentationType = core::int */ {
|
|
constructor • = self::Class2|;
|
|
tearoff • = self::Class2|get#;
|
|
}
|
|
inline class Class3 /* declaredRepresentationType = core::int */ {
|
|
}
|
|
inline class Class4 /* declaredRepresentationType = core::int */ {
|
|
constructor • = self::Class4|;
|
|
tearoff • = self::Class4|get#;
|
|
}
|
|
inline class Class5 /* declaredRepresentationType = core::int */ {
|
|
constructor • = self::Class5|;
|
|
tearoff • = self::Class5|get#;
|
|
}
|
|
inline class Class6 /* declaredRepresentationType = core::int */ {
|
|
constructor • = self::Class6|;
|
|
tearoff • = self::Class6|get#;
|
|
}
|
|
static method Class1|(core::int field) → self::Class1 {
|
|
final self::Class1 #this = field;
|
|
return #this;
|
|
}
|
|
static method Class1|get#(core::int field) → self::Class1
|
|
return self::Class1|(field);
|
|
static method Class2|(core::int field) → self::Class2 {
|
|
final self::Class2 #this = field;
|
|
return #this;
|
|
}
|
|
static method Class2|get#(core::int field) → self::Class2
|
|
return self::Class2|(field);
|
|
static method Class4|(core::int field, dynamic nonexisting) → self::Class4 {
|
|
final self::Class4 #this = field;
|
|
final dynamic #t1 = invalid-expression "pkg/front_end/testcases/inline_class/initializers.dart:24:27: Error: 'nonexisting' isn't an instance field of this class.
|
|
Class4(this.field, this.nonexisting);
|
|
^^^^^^^^^^^";
|
|
return #this;
|
|
}
|
|
static method Class4|get#(core::int field, dynamic nonexisting) → self::Class4
|
|
return self::Class4|(field, nonexisting);
|
|
static method Class5|(core::int field) → self::Class5 {
|
|
final self::Class5 #this = field;
|
|
final dynamic #t2 = invalid-expression "pkg/front_end/testcases/inline_class/initializers.dart:30:35: Error: 'field' was already initialized by this constructor.
|
|
Class5(this.field) : this.field = 42;
|
|
^";
|
|
return #this;
|
|
}
|
|
static method Class5|get#(core::int field) → self::Class5
|
|
return self::Class5|(field);
|
|
static method Class6|(core::int field) → self::Class6 {
|
|
final self::Class6 #this = field;
|
|
final dynamic #t3 = invalid-expression "pkg/front_end/testcases/inline_class/initializers.dart:36:29: Error: 'nonexisting' isn't an instance field of this class.
|
|
Class6(this.field) : this.nonexisting = 42;
|
|
^^^^^^^^^^^";
|
|
return #this;
|
|
}
|
|
static method Class6|get#(core::int field) → self::Class6
|
|
return self::Class6|(field);
|