Skip to content

Commit a2b7623

Browse files
scheglovCommit Bot
authored andcommitted
Add 'const' modifier to enum constructor in tests.
Change-Id: I8b743d3e5fb581d0626d53e9c2a8b918dc719104 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230381 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Samuel Rawlins <srawlins@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
1 parent 9573154 commit a2b7623

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

pkg/analyzer/test/src/dart/resolution/enum_test.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class EnumDriverResolutionTest extends PubPackageResolutionTest {
1919
await assertNoErrorsInCode(r'''
2020
enum E {
2121
v([]);
22-
E(List<int> a);
22+
const E(List<int> a);
2323
}
2424
''');
2525

@@ -30,7 +30,7 @@ enum E {
3030
await assertNoErrorsInCode(r'''
3131
enum E {
3232
v(<void Function(double)>[]);
33-
E(Object a);
33+
const E(Object a);
3434
}
3535
''');
3636

@@ -50,7 +50,7 @@ enum E {
5050
await assertNoErrorsInCode(r'''
5151
enum E<T> {
5252
v.named(42);
53-
E.named(T a);
53+
const E.named(T a);
5454
}
5555
''');
5656

@@ -76,7 +76,7 @@ enum E<T> {
7676
await assertNoErrorsInCode(r'''
7777
enum E<T> {
7878
v(42);
79-
E(T a);
79+
const E(T a);
8080
}
8181
''');
8282

@@ -102,7 +102,7 @@ enum E<T> {
102102
await assertNoErrorsInCode(r'''
103103
enum E<T> {
104104
v<double>.named(42);
105-
E.named(T a);
105+
const E.named(T a);
106106
}
107107
''');
108108

@@ -134,7 +134,7 @@ enum E<T> {
134134
await assertNoErrorsInCode(r'''
135135
enum E {
136136
v.named(42);
137-
E.named(int a);
137+
const E.named(int a);
138138
}
139139
''');
140140

@@ -154,7 +154,7 @@ enum E {
154154
await assertNoErrorsInCode(r'''
155155
enum E {
156156
v(42);
157-
E(int a);
157+
const E(int a);
158158
}
159159
''');
160160

@@ -188,7 +188,7 @@ enum E {
188188
await assertNoErrorsInCode(r'''
189189
enum E {
190190
v.named(42);
191-
E(int a);
191+
const E(int a);
192192
}
193193
''');
194194

@@ -205,7 +205,7 @@ enum E {
205205
await assertNoErrorsInCode(r'''
206206
enum E {
207207
v(42);
208-
E.named(int a);
208+
const E.named(int a);
209209
}
210210
''');
211211

pkg/analyzer/test/src/summary/resynthesize_common.dart

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17539,7 +17539,7 @@ library
1753917539
var library = await checkLibrary(r'''
1754017540
enum E<T> {
1754117541
int(1), string('2');
17542-
E(T a);
17542+
const E(T a);
1754317543
}
1754417544
''');
1754517545
checkElementText(library, r'''
@@ -17640,15 +17640,15 @@ library
1764017640
synthetic final _name @-1
1764117641
type: String
1764217642
constructors
17643-
@37
17643+
const @43
1764417644
parameters
1764517645
requiredPositional final this.index @-1
1764617646
type: int
1764717647
field: self::@enum::E::@field::index
1764817648
requiredPositional final this._name @-1
1764917649
type: String
1765017650
field: self::@enum::E::@field::_name
17651-
requiredPositional a @41
17651+
requiredPositional a @47
1765217652
type: T
1765317653
accessors
1765417654
synthetic static get int @-1
@@ -17752,7 +17752,7 @@ library
1775217752
var library = await checkLibrary(r'''
1775317753
enum E<T> {
1775417754
v<double>(42);
17755-
E(T a);
17755+
const E(T a);
1775617756
}
1775717757
''');
1775817758
checkElementText(library, r'''
@@ -17826,15 +17826,15 @@ library
1782617826
synthetic final _name @-1
1782717827
type: String
1782817828
constructors
17829-
@31
17829+
const @37
1783017830
parameters
1783117831
requiredPositional final this.index @-1
1783217832
type: int
1783317833
field: self::@enum::E::@field::index
1783417834
requiredPositional final this._name @-1
1783517835
type: String
1783617836
field: self::@enum::E::@field::_name
17837-
requiredPositional a @35
17837+
requiredPositional a @41
1783817838
type: T
1783917839
accessors
1784017840
synthetic static get v @-1
@@ -17935,7 +17935,7 @@ library
1793517935
var library = await checkLibrary(r'''
1793617936
enum E {
1793717937
v.named(42);
17938-
E.named(int a);
17938+
const E.named(int a);
1793917939
}
1794017940
''');
1794117941
checkElementText(library, r'''
@@ -17992,17 +17992,17 @@ library
1799217992
synthetic final _name @-1
1799317993
type: String
1799417994
constructors
17995-
named @28
17996-
periodOffset: 27
17997-
nameEnd: 33
17995+
const named @34
17996+
periodOffset: 33
17997+
nameEnd: 39
1799817998
parameters
1799917999
requiredPositional final this.index @-1
1800018000
type: int
1800118001
field: self::@enum::E::@field::index
1800218002
requiredPositional final this._name @-1
1800318003
type: String
1800418004
field: self::@enum::E::@field::_name
18005-
requiredPositional a @38
18005+
requiredPositional a @44
1800618006
type: int
1800718007
accessors
1800818008
synthetic static get v @-1
@@ -18023,7 +18023,7 @@ library
1802318023
var library = await checkLibrary(r'''
1802418024
enum E {
1802518025
v(42);
18026-
E(int a);
18026+
const E(int a);
1802718027
}
1802818028
''');
1802918029
checkElementText(library, r'''
@@ -18080,15 +18080,15 @@ library
1808018080
synthetic final _name @-1
1808118081
type: String
1808218082
constructors
18083-
@20
18083+
const @26
1808418084
parameters
1808518085
requiredPositional final this.index @-1
1808618086
type: int
1808718087
field: self::@enum::E::@field::index
1808818088
requiredPositional final this._name @-1
1808918089
type: String
1809018090
field: self::@enum::E::@field::_name
18091-
requiredPositional a @26
18091+
requiredPositional a @32
1809218092
type: int
1809318093
accessors
1809418094
synthetic static get v @-1

0 commit comments

Comments
 (0)