Skip to content

Commit bb2ba56

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Don't write 'returnType' and 'type' of ExecutableFragmentImpl.
Write types of elements instead. Change-Id: I753fa813b0c43810c3b014e914ecdf89a9150877 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/440061 Reviewed-by: Samuel Rawlins <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 9e76913 commit bb2ba56

40 files changed

+186
-1394
lines changed

pkg/analyzer/test/generated/strong_mode_test.dart

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3591,10 +3591,12 @@ FunctionDeclaration
35913591
staticType: Null
35923592
semicolon: ;
35933593
declaredElement: <testLibraryFragment> f@2
3594-
type: T Function<T>(T)
3594+
element: <testLibrary>::@function::f
3595+
type: T Function<T>(T)
35953596
staticType: T Function<T>(T)
35963597
declaredElement: <testLibraryFragment> f@2
3597-
type: T Function<T>(T)
3598+
element: <testLibrary>::@function::f
3599+
type: T Function<T>(T)
35983600
''');
35993601
}
36003602

@@ -3644,10 +3646,12 @@ FunctionDeclaration
36443646
staticType: Null
36453647
semicolon: ;
36463648
declaredElement: <testLibraryFragment> f@2
3647-
type: T Function<T extends num>(T)
3649+
element: <testLibrary>::@function::f
3650+
type: T Function<T extends num>(T)
36483651
staticType: T Function<T extends num>(T)
36493652
declaredElement: <testLibraryFragment> f@2
3650-
type: T Function<T extends num>(T)
3653+
element: <testLibrary>::@function::f
3654+
type: T Function<T extends num>(T)
36513655
''');
36523656
}
36533657

@@ -3707,7 +3711,8 @@ MethodDeclaration
37073711
staticType: Null
37083712
semicolon: ;
37093713
declaredElement: <testLibraryFragment> f@24
3710-
type: T Function<T>(T)
3714+
element: <testLibrary>::@class::C::@method::f
3715+
type: T Function<T>(T)
37113716
''');
37123717
}
37133718

@@ -4246,7 +4251,8 @@ MethodInvocation
42464251
element: e@93
42474252
staticType: dynamic
42484253
declaredElement: <testLibraryFragment> null@null
4249-
type: dynamic Function(dynamic)
4254+
element: null@null
4255+
type: dynamic Function(dynamic)
42504256
correspondingParameter: ParameterMember
42514257
baseElement: f@null
42524258
substitution: {T: dynamic}
@@ -4290,7 +4296,8 @@ MethodInvocation
42904296
literal: 3
42914297
staticType: int
42924298
declaredElement: <testLibraryFragment> null@null
4293-
type: int Function(dynamic)
4299+
element: null@null
4300+
type: int Function(dynamic)
42944301
correspondingParameter: ParameterMember
42954302
baseElement: f@null
42964303
substitution: {T: int}
@@ -4605,7 +4612,8 @@ MethodDeclaration
46054612
staticType: Null
46064613
semicolon: ;
46074614
declaredElement: <testLibraryFragment> f@59
4608-
type: T Function<T>(T)
4615+
element: <testLibrary>::@class::D::@method::f
4616+
type: T Function<T>(T)
46094617
''');
46104618
}
46114619

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ ConstructorFieldInitializer
121121
semicolon: ;
122122
rightBracket: }
123123
declaredElement: <testLibraryFragment> null@null
124-
type: int Function()
124+
element: null@null
125+
type: int Function()
125126
staticType: int Function()
126127
rightParenthesis: )
127128
staticType: int Function()
@@ -173,7 +174,8 @@ ConstructorFieldInitializer
173174
staticInvokeType: num Function(num)
174175
staticType: int
175176
declaredElement: <testLibraryFragment> null@null
176-
type: int Function()
177+
element: null@null
178+
type: int Function()
177179
staticType: int Function()
178180
rightParenthesis: )
179181
staticType: int Function()

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

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ ConstructorDeclaration
121121
semicolon: ;
122122
rightBracket: }
123123
declaredElement: <testLibraryFragment> new@null
124-
type: B Function(a)
124+
element: <testLibrary>::@class::B::@constructor::new
125+
type: B Function(a)
125126
''');
126127
}
127128

@@ -162,7 +163,8 @@ ConstructorDeclaration
162163
body: EmptyFunctionBody
163164
semicolon: ;
164165
declaredElement: <testLibraryFragment> new@null
165-
type: B Function()
166+
element: <testLibrary>::@class::B::@constructor::new
167+
type: B Function()
166168
''');
167169
}
168170

@@ -215,7 +217,8 @@ ConstructorDeclaration
215217
body: EmptyFunctionBody
216218
semicolon: ;
217219
declaredElement: <testLibraryFragment> new@null
218-
type: B<U> Function()
220+
element: <testLibrary>::@class::B::@constructor::new
221+
type: B<U> Function()
219222
''');
220223
}
221224

@@ -259,7 +262,8 @@ ConstructorDeclaration
259262
body: EmptyFunctionBody
260263
semicolon: ;
261264
declaredElement: <testLibraryFragment> new@null
262-
type: B Function()
265+
element: <testLibrary>::@class::B::@constructor::new
266+
type: B Function()
263267
''');
264268
}
265269

@@ -297,7 +301,8 @@ ConstructorDeclaration
297301
body: EmptyFunctionBody
298302
semicolon: ;
299303
declaredElement: <testLibraryFragment> named@55
300-
type: B Function()
304+
element: <testLibrary>::@class::B::@constructor::named
305+
type: B Function()
301306
''');
302307
}
303308

@@ -345,7 +350,8 @@ ConstructorDeclaration
345350
body: EmptyFunctionBody
346351
semicolon: ;
347352
declaredElement: <testLibraryFragment> named@64
348-
type: B<U> Function()
353+
element: <testLibrary>::@class::B::@constructor::named
354+
type: B<U> Function()
349355
''');
350356
}
351357

@@ -386,7 +392,8 @@ ConstructorDeclaration
386392
body: EmptyFunctionBody
387393
semicolon: ;
388394
declaredElement: <testLibraryFragment> named@61
389-
type: B Function()
395+
element: <testLibrary>::@class::B::@constructor::named
396+
type: B Function()
390397
''');
391398
}
392399
}

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ MethodDeclaration
374374
staticType: Never
375375
semicolon: ;
376376
declaredElement: <testLibraryFragment> foo@25
377-
type: T Function()
377+
element: <testLibrary>::@enum::E::@getter::foo
378+
type: T Function()
378379
''');
379380
}
380381

@@ -475,7 +476,8 @@ MethodDeclaration
475476
staticType: int
476477
semicolon: ;
477478
declaredElement: <testLibraryFragment> foo@23
478-
type: int Function<U>(T, U)
479+
element: <testLibrary>::@enum::E::@method::foo
480+
type: int Function<U>(T, U)
479481
''');
480482
}
481483

@@ -504,7 +506,8 @@ MethodDeclaration
504506
literal: 'E'
505507
semicolon: ;
506508
declaredElement: <testLibraryFragment> toString@23
507-
type: String Function()
509+
element: <testLibrary>::@enum::E::@method::toString
510+
type: String Function()
508511
''');
509512
}
510513

@@ -591,7 +594,8 @@ MethodDeclaration
591594
leftBracket: {
592595
rightBracket: }
593596
declaredElement: <testLibraryFragment> foo@23
594-
type: void Function(T)
597+
element: <testLibrary>::@enum::E::@setter::foo
598+
type: void Function(T)
595599
''');
596600
}
597601

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ ExtensionTypeDeclaration
8989
body: EmptyFunctionBody
9090
semicolon: ;
9191
declaredElement: <testLibraryFragment> named@31
92-
type: A Function(int)
92+
element: <testLibrary>::@extensionType::A::@constructor::named
93+
type: A Function(int)
9394
rightBracket: }
9495
declaredElement: <testLibraryFragment> A@15
9596
''');
@@ -155,7 +156,8 @@ ExtensionTypeDeclaration
155156
body: EmptyFunctionBody
156157
semicolon: ;
157158
declaredElement: <testLibraryFragment> named@37
158-
type: A Function(int)
159+
element: <testLibrary>::@extensionType::A::@constructor::named
160+
type: A Function(int)
159161
rightBracket: }
160162
declaredElement: <testLibraryFragment> A@15
161163
''');
@@ -287,7 +289,8 @@ MethodDeclaration
287289
semicolon: ;
288290
rightBracket: }
289291
declaredElement: <testLibraryFragment> foo@37
290-
type: void Function<U>(T, U)
292+
element: <testLibrary>::@extensionType::A::@method::foo
293+
type: void Function<U>(T, U)
291294
''');
292295
}
293296

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

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,12 @@ FunctionDeclarationStatement
7777
staticType: T
7878
semicolon: ;
7979
declaredElement: <testLibraryFragment> g@15
80-
type: T Function<T, U>(T, U)
80+
element: g@15
81+
type: T Function<T, U>(T, U)
8182
staticType: T Function<T, U>(T, U)
8283
declaredElement: <testLibraryFragment> g@15
83-
type: T Function<T, U>(T, U)
84+
element: g@15
85+
type: T Function<T, U>(T, U)
8486
''');
8587
}
8688

@@ -165,10 +167,12 @@ FunctionDeclarationStatement
165167
leftBracket: {
166168
rightBracket: }
167169
declaredElement: <testLibraryFragment> g@18
168-
type: void Function<T extends U, U, V extends U>(T, U, V)
170+
element: g@18
171+
type: void Function<T extends U, U, V extends U>(T, U, V)
169172
staticType: void Function<T extends U, U, V extends U>(T, U, V)
170173
declaredElement: <testLibraryFragment> g@18
171-
type: void Function<T extends U, U, V extends U>(T, U, V)
174+
element: g@18
175+
type: void Function<T extends U, U, V extends U>(T, U, V)
172176
''');
173177
}
174178

@@ -224,10 +228,12 @@ FunctionDeclarationStatement
224228
leftBracket: {
225229
rightBracket: }
226230
declaredElement: <testLibraryFragment> g@18
227-
type: void Function<T>({T? a})
231+
element: g@18
232+
type: void Function<T>({T? a})
228233
staticType: void Function<T>({T? a})
229234
declaredElement: <testLibraryFragment> g@18
230-
type: void Function<T>({T? a})
235+
element: g@18
236+
type: void Function<T>({T? a})
231237
''');
232238
}
233239

@@ -283,10 +289,12 @@ FunctionDeclarationStatement
283289
leftBracket: {
284290
rightBracket: }
285291
declaredElement: <testLibraryFragment> g@18
286-
type: void Function<T>([T?])
292+
element: g@18
293+
type: void Function<T>([T?])
287294
staticType: void Function<T>([T?])
288295
declaredElement: <testLibraryFragment> g@18
289-
type: void Function<T>([T?])
296+
element: g@18
297+
type: void Function<T>([T?])
290298
''');
291299
}
292300

@@ -343,10 +351,12 @@ FunctionDeclarationStatement
343351
leftBracket: {
344352
rightBracket: }
345353
declaredElement: <testLibraryFragment> g@18
346-
type: void Function<T>({required T? a})
354+
element: g@18
355+
type: void Function<T>({required T? a})
347356
staticType: void Function<T>({required T? a})
348357
declaredElement: <testLibraryFragment> g@18
349-
type: void Function<T>({required T? a})
358+
element: g@18
359+
type: void Function<T>({required T? a})
350360
''');
351361
}
352362

@@ -395,10 +405,12 @@ FunctionDeclarationStatement
395405
leftBracket: {
396406
rightBracket: }
397407
declaredElement: <testLibraryFragment> g@18
398-
type: void Function<T>(T)
408+
element: g@18
409+
type: void Function<T>(T)
399410
staticType: void Function<T>(T)
400411
declaredElement: <testLibraryFragment> g@18
401-
type: void Function<T>(T)
412+
element: g@18
413+
type: void Function<T>(T)
402414
''');
403415
}
404416

@@ -426,10 +438,12 @@ FunctionDeclarationStatement
426438
leftBracket: {
427439
rightBracket: }
428440
declaredElement: <testLibraryFragment> g@13
429-
type: Null Function()
441+
element: g@13
442+
type: Null Function()
430443
staticType: Null Function()
431444
declaredElement: <testLibraryFragment> g@13
432-
type: Null Function()
445+
element: g@13
446+
type: Null Function()
433447
''');
434448
}
435449

@@ -459,10 +473,12 @@ FunctionDeclarationStatement
459473
staticType: int
460474
semicolon: ;
461475
declaredElement: <testLibraryFragment> g@13
462-
type: int Function()
476+
element: g@13
477+
type: int Function()
463478
staticType: int Function()
464479
declaredElement: <testLibraryFragment> g@13
465-
type: int Function()
480+
element: g@13
481+
type: int Function()
466482
''');
467483
}
468484
}

0 commit comments

Comments
 (0)