Skip to content

Commit 0d0dfda

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Stop including VariableFragmentImpl.type into text output.
Elements have types, not fragments. In future CLs I will remove type from VariableFragmentImpl altogether. Change-Id: I77e2a4ea08f315bb2a81f069eb953d4361ca9e66 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/439825 Reviewed-by: Samuel Rawlins <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 33ddf2f commit 0d0dfda

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+265
-398
lines changed

pkg/analyzer/test/generated/strong_mode_test.dart

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest {
8989
_isListOf = assertions.isListOf;
9090
_isMapOf = assertions.isMapOf;
9191
_isFunction2Of = assertions.isFunction2Of;
92-
_isFutureOf = _isInstantiationOf(
93-
_hasElement(typeProvider.futureElement),
94-
);
92+
_isFutureOf = _isInstantiationOf(_hasElement(typeProvider.futureElement));
9593
_isFutureOrOf = _isInstantiationOf(
9694
_hasElement(typeProvider.futureOrElement),
9795
);
@@ -3583,7 +3581,8 @@ FunctionDeclaration
35833581
type: T
35843582
name: x
35853583
declaredElement: <testLibraryFragment> x@9
3586-
type: T
3584+
element: isPublic
3585+
type: T
35873586
rightParenthesis: )
35883587
body: ExpressionFunctionBody
35893588
functionDefinition: =>
@@ -3635,7 +3634,8 @@ FunctionDeclaration
36353634
type: T
36363635
name: x
36373636
declaredElement: <testLibraryFragment> x@21
3638-
type: T
3637+
element: isPublic
3638+
type: T
36393639
rightParenthesis: )
36403640
body: ExpressionFunctionBody
36413641
functionDefinition: =>
@@ -3697,7 +3697,8 @@ MethodDeclaration
36973697
type: T
36983698
name: x
36993699
declaredElement: <testLibraryFragment> x@31
3700-
type: T
3700+
element: isPublic
3701+
type: T
37013702
rightParenthesis: )
37023703
body: ExpressionFunctionBody
37033704
functionDefinition: =>
@@ -4235,7 +4236,8 @@ MethodInvocation
42354236
parameter: SimpleFormalParameter
42364237
name: e
42374238
declaredElement: <testLibraryFragment> e@93
4238-
type: dynamic
4239+
element: hasImplicitType isPublic
4240+
type: dynamic
42394241
rightParenthesis: )
42404242
body: ExpressionFunctionBody
42414243
functionDefinition: =>
@@ -4279,7 +4281,8 @@ MethodInvocation
42794281
parameter: SimpleFormalParameter
42804282
name: e
42814283
declaredElement: <testLibraryFragment> e@115
4282-
type: dynamic
4284+
element: hasImplicitType isPublic
4285+
type: dynamic
42834286
rightParenthesis: )
42844287
body: ExpressionFunctionBody
42854288
functionDefinition: =>
@@ -4592,7 +4595,8 @@ MethodDeclaration
45924595
type: T
45934596
name: y
45944597
declaredElement: <testLibraryFragment> y@66
4595-
type: T
4598+
element: isPublic
4599+
type: T
45964600
rightParenthesis: )
45974601
body: ExpressionFunctionBody
45984602
functionDefinition: =>

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ CastPattern
3131
keyword: var
3232
name: y
3333
declaredFragment: isPublic y@29
34-
type: null
3534
element: hasImplicitType isPublic
3635
type: int
3736
matchedValueType: int
@@ -91,7 +90,6 @@ PatternVariableDeclaration
9190
pattern: DeclaredVariablePattern
9291
name: a
9392
declaredFragment: isPublic a@19
94-
type: null
9593
element: hasImplicitType isPublic
9694
type: int
9795
matchedValueType: int

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ ConstructorDeclaration
106106
type: a
107107
name: a
108108
declaredElement: <testLibraryFragment> a@28
109-
type: a
109+
element: isPublic
110+
type: a
110111
rightParenthesis: )
111112
body: BlockFunctionBody
112113
block: Block

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ DeclaredVariablePattern
3333
keyword: final
3434
name: y
3535
declaredFragment: isFinal isPublic y@46
36-
type: null
3736
element: hasImplicitType isFinal isPublic
3837
type: int
3938
matchedValueType: int
@@ -62,7 +61,6 @@ DeclaredVariablePattern
6261
type: int
6362
name: y
6463
declaredFragment: isFinal isPublic y@46
65-
type: int
6664
element: isFinal isPublic
6765
type: int
6866
matchedValueType: dynamic
@@ -84,7 +82,6 @@ ListPattern
8482
DeclaredVariablePattern
8583
name: a
8684
declaredFragment: isFinal isPublic a@54
87-
type: null
8885
element: hasImplicitType isFinal isPublic
8986
type: int
9087
matchedValueType: int
@@ -111,7 +108,6 @@ ListPattern
111108
pattern: DeclaredVariablePattern
112109
name: a
113110
declaredFragment: isFinal isPublic a@57
114-
type: null
115111
element: hasImplicitType isFinal isPublic
116112
type: List<int>
117113
matchedValueType: List<int>
@@ -141,7 +137,6 @@ MapPattern
141137
value: DeclaredVariablePattern
142138
name: a
143139
declaredFragment: isFinal isPublic a@57
144-
type: null
145140
element: hasImplicitType isFinal isPublic
146141
type: int
147142
matchedValueType: int
@@ -174,7 +169,6 @@ ObjectPattern
174169
pattern: DeclaredVariablePattern
175170
name: a
176171
declaredFragment: isFinal isPublic a@63
177-
type: null
178172
element: hasImplicitType isFinal isPublic
179173
type: int
180174
matchedValueType: int
@@ -198,7 +192,6 @@ ParenthesizedPattern
198192
pattern: DeclaredVariablePattern
199193
name: a
200194
declaredFragment: isFinal isPublic a@54
201-
type: null
202195
element: hasImplicitType isFinal isPublic
203196
type: int
204197
matchedValueType: int
@@ -223,7 +216,6 @@ RecordPattern
223216
pattern: DeclaredVariablePattern
224217
name: a
225218
declaredFragment: isFinal isPublic a@54
226-
type: null
227219
element: hasImplicitType isFinal isPublic
228220
type: int
229221
matchedValueType: int
@@ -254,7 +246,6 @@ DeclaredVariablePattern
254246
type: int
255247
name: y
256248
declaredFragment: isPublic y@40
257-
type: int
258249
element: isPublic
259250
type: int
260251
matchedValueType: dynamic
@@ -279,7 +270,6 @@ DeclaredVariablePattern
279270
keyword: var
280271
name: y
281272
declaredFragment: isPublic y@54
282-
type: null
283273
element: hasImplicitType isPublic
284274
type: T
285275
matchedValueType: T & int
@@ -301,7 +291,6 @@ DeclaredVariablePattern
301291
keyword: var
302292
name: y
303293
declaredFragment: isPublic y@33
304-
type: null
305294
element: hasImplicitType isPublic
306295
type: int
307296
matchedValueType: int
@@ -323,7 +312,6 @@ DeclaredVariablePattern
323312
keyword: var
324313
name: y
325314
declaredFragment: isPublic y@36
326-
type: null
327315
element: hasImplicitType isPublic
328316
type: dynamic
329317
matchedValueType: Never?
@@ -345,7 +333,6 @@ DeclaredVariablePattern
345333
keyword: var
346334
name: y
347335
declaredFragment: isPublic y@34
348-
type: null
349336
element: hasImplicitType isPublic
350337
type: dynamic
351338
matchedValueType: Null
@@ -370,7 +357,6 @@ DeclaredVariablePattern
370357
keyword: var
371358
name: y
372359
declaredFragment: isPublic y@44
373-
type: null
374360
element: hasImplicitType isPublic
375361
type: int
376362
matchedValueType: int
@@ -396,7 +382,6 @@ CastPattern
396382
keyword: var
397383
name: y
398384
declaredFragment: isPublic y@44
399-
type: null
400385
element: hasImplicitType isPublic
401386
type: int
402387
matchedValueType: int

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,15 @@ GenericFunctionType
5858
element2: dart:core::@class::double
5959
type: double
6060
declaredElement: <testLibraryFragment> null@null
61-
type: double
61+
element: isPrivate
62+
type: double
6263
rightParenthesis: )
6364
declaredElement: GenericFunctionTypeElement
6465
parameters
6566
<empty>
6667
kind: required positional
67-
type: double
68+
element:
69+
type: double
6870
returnType: void
6971
type: void Function(double)
7072
type: void Function(double)
@@ -454,15 +456,17 @@ MethodDeclaration
454456
type: T
455457
name: t
456458
declaredElement: <testLibraryFragment> t@32
457-
type: T
459+
element: isPublic
460+
type: T
458461
parameter: SimpleFormalParameter
459462
type: NamedType
460463
name: U
461464
element2: #E1 U
462465
type: U
463466
name: u
464467
declaredElement: <testLibraryFragment> u@37
465-
type: U
468+
element: isPublic
469+
type: U
466470
rightParenthesis: )
467471
body: ExpressionFunctionBody
468472
functionDefinition: =>
@@ -579,7 +583,8 @@ MethodDeclaration
579583
type: T
580584
name: a
581585
declaredElement: <testLibraryFragment> a@29
582-
type: T
586+
element: isPublic
587+
type: T
583588
rightParenthesis: )
584589
body: BlockFunctionBody
585590
block: Block

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -484,13 +484,15 @@ GenericFunctionType
484484
element2: dart:core::@class::int
485485
type: int
486486
declaredElement: <testLibraryFragment> null@null
487-
type: int
487+
element: isPrivate
488+
type: int
488489
rightParenthesis: )
489490
declaredElement: GenericFunctionTypeElement
490491
parameters
491492
<empty>
492493
kind: required positional
493-
type: int
494+
element:
495+
type: int
494496
returnType: int
495497
type: int Function(int)
496498
type: int Function(int)
@@ -595,13 +597,15 @@ GenericFunctionType
595597
element2: dart:core::@class::String
596598
type: String
597599
declaredElement: <testLibraryFragment> null@null
598-
type: String
600+
element: isPrivate
601+
type: String
599602
rightParenthesis: )
600603
declaredElement: GenericFunctionTypeElement
601604
parameters
602605
<empty>
603606
kind: required positional
604-
type: String
607+
element:
608+
type: String
605609
returnType: int
606610
type: int Function(String)
607611
type: int Function(String)

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ ExtensionTypeDeclaration
8383
period: .
8484
name: it
8585
declaredElement: <testLibraryFragment> it@42
86-
type: int
86+
element: hasImplicitType isFinal isPublic
87+
type: int
8788
rightParenthesis: )
8889
body: EmptyFunctionBody
8990
semicolon: ;
@@ -136,7 +137,8 @@ ExtensionTypeDeclaration
136137
type: int
137138
name: a
138139
declaredElement: <testLibraryFragment> a@47
139-
type: int
140+
element: isPublic
141+
type: int
140142
rightParenthesis: )
141143
separator: :
142144
initializers
@@ -255,15 +257,17 @@ MethodDeclaration
255257
type: T
256258
name: t
257259
declaredElement: <testLibraryFragment> t@46
258-
type: T
260+
element: isPublic
261+
type: T
259262
parameter: SimpleFormalParameter
260263
type: NamedType
261264
name: U
262265
element2: #E1 U
263266
type: U
264267
name: u
265268
declaredElement: <testLibraryFragment> u@51
266-
type: U
269+
element: isPublic
270+
type: U
267271
rightParenthesis: )
268272
body: BlockFunctionBody
269273
block: Block

0 commit comments

Comments
 (0)