You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// pkg/front_end/testcases/declaring_constructors/class_primary_constructor.dart:10:14: Error: Final field 'i' is not initialized.
6
+
// Try to initialize the field in the declaration or in every constructor.
7
+
// final int? i; // Error
8
+
// ^
9
+
//
10
+
// pkg/front_end/testcases/declaring_constructors/class_primary_constructor.dart:13:15: Error: Constructor is marked 'const' so all fields must be final.
11
+
// class const C4() { // Error
12
+
// ^
13
+
// pkg/front_end/testcases/declaring_constructors/class_primary_constructor.dart:14:8: Context: Field isn't final, but constructor is 'const'.
14
+
// int? i;
15
+
// ^
16
+
//
17
+
import self as self;
18
+
import "dart:core" as core;
19
+
20
+
class C1 extends core::Object {
21
+
constructor •() → self::C1
22
+
: super core::Object::•()
23
+
;
24
+
}
25
+
class C2 extends core::Object /*hasConstConstructor*/ {
26
+
const constructor •() → self::C2
27
+
: super core::Object::•()
28
+
;
29
+
}
30
+
class C3 extends core::Object {
31
+
final field core::int? i = null;
32
+
constructor •() → self::C3
33
+
: super core::Object::•()
34
+
;
35
+
}
36
+
class C4 extends core::Object /*hasConstConstructor*/ {
// pkg/front_end/testcases/declaring_constructors/class_primary_constructor.dart:10:14: Error: Final field 'i' is not initialized.
6
+
// Try to initialize the field in the declaration or in every constructor.
7
+
// final int? i; // Error
8
+
// ^
9
+
//
10
+
// pkg/front_end/testcases/declaring_constructors/class_primary_constructor.dart:13:15: Error: Constructor is marked 'const' so all fields must be final.
11
+
// class const C4() { // Error
12
+
// ^
13
+
// pkg/front_end/testcases/declaring_constructors/class_primary_constructor.dart:14:8: Context: Field isn't final, but constructor is 'const'.
14
+
// int? i;
15
+
// ^
16
+
//
17
+
import self as self;
18
+
import "dart:core" as core;
19
+
20
+
class C1 extends core::Object {
21
+
constructor •() → self::C1
22
+
: super core::Object::•()
23
+
;
24
+
}
25
+
class C2 extends core::Object /*hasConstConstructor*/ {
26
+
const constructor •() → self::C2
27
+
: super core::Object::•()
28
+
;
29
+
}
30
+
class C3 extends core::Object {
31
+
final field core::int? i = null;
32
+
constructor •() → self::C3
33
+
: super core::Object::•()
34
+
;
35
+
}
36
+
class C4 extends core::Object /*hasConstConstructor*/ {
0 commit comments