Skip to content

Commit ce32e04

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Fix for reference of unnamed constructor of extension type.
Change-Id: Id01fd9bdaad84e31622e220d0ecc9b3b73f48287 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434941 Reviewed-by: Paul Berry <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 4b61c79 commit ce32e04

File tree

10 files changed

+77
-77
lines changed

10 files changed

+77
-77
lines changed

pkg/analyzer/lib/src/dart/analysis/driver.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ testFineAfterLibraryAnalyzerHook;
110110
// TODO(scheglov): Clean up the list of implicitly analyzed files.
111111
class AnalysisDriver {
112112
/// The version of data format, should be incremented on every format change.
113-
static const int DATA_VERSION = 472;
113+
static const int DATA_VERSION = 475;
114114

115115
/// The number of exception contexts allowed to write. Once this field is
116116
/// zero, we stop writing any new exception contexts in this process.

pkg/analyzer/lib/src/summary2/element_builder.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1913,7 +1913,7 @@ class ElementBuilder extends ThrowingAstVisitor<void> {
19131913
var containerElement = containerBuilder.element;
19141914
var containerRef = containerElement.reference!.getChild('@constructor');
19151915
var elementReference = containerRef.addChild(
1916-
extensionFragment.name2 ?? 'new',
1916+
constructorFragment.name2,
19171917
);
19181918

19191919
ConstructorElementImpl2(

pkg/analyzer/test/src/dart/ast/element_locator_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ dart:core::@class::num::@method::+
565565
var node = findNode.singleRepresentationConstructorName;
566566
var element = ElementLocator.locate2(node);
567567
_assertElement(element, r'''
568-
<testLibrary>::@extensionType::A::@constructor::A
568+
<testLibrary>::@extensionType::A::@constructor::named
569569
''');
570570
}
571571

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ InstanceCreationExpression
10421042
element2: <testLibrary>::@extensionType::A
10431043
type: A<int>
10441044
element: ConstructorMember
1045-
baseElement: <testLibrary>::@extensionType::A::@constructor::A
1045+
baseElement: <testLibrary>::@extensionType::A::@constructor::new
10461046
substitution: {T: int}
10471047
argumentList: ArgumentList
10481048
leftParenthesis: (
@@ -1114,9 +1114,9 @@ InstanceCreationExpression
11141114
period: .
11151115
name: SimpleIdentifier
11161116
token: named
1117-
element: <testLibrary>::@extensionType::A::@constructor::A
1117+
element: <testLibrary>::@extensionType::A::@constructor::named
11181118
staticType: null
1119-
element: <testLibrary>::@extensionType::A::@constructor::A
1119+
element: <testLibrary>::@extensionType::A::@constructor::named
11201120
argumentList: ArgumentList
11211121
leftParenthesis: (
11221122
arguments
@@ -1146,7 +1146,7 @@ InstanceCreationExpression
11461146
name: A
11471147
element2: <testLibrary>::@extensionType::A
11481148
type: A
1149-
element: <testLibrary>::@extensionType::A::@constructor::A
1149+
element: <testLibrary>::@extensionType::A::@constructor::new
11501150
argumentList: ArgumentList
11511151
leftParenthesis: (
11521152
arguments

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -642,9 +642,9 @@ Annotation
642642
period: .
643643
identifier: SimpleIdentifier
644644
token: named
645-
element: <testLibrary>::@extensionType::A::@constructor::A
645+
element: <testLibrary>::@extensionType::A::@constructor::named
646646
staticType: null
647-
element: <testLibrary>::@extensionType::A::@constructor::A
647+
element: <testLibrary>::@extensionType::A::@constructor::named
648648
staticType: null
649649
arguments: ArgumentList
650650
leftParenthesis: (
@@ -654,7 +654,7 @@ Annotation
654654
correspondingParameter: <testLibraryFragment>::@extensionType::A::@constructor::named::@parameter::it#element
655655
staticType: int
656656
rightParenthesis: )
657-
element2: <testLibrary>::@extensionType::A::@constructor::A
657+
element2: <testLibrary>::@extensionType::A::@constructor::named
658658
''');
659659

660660
_assertAnnotationValueText(node, r'''
@@ -686,7 +686,7 @@ Annotation
686686
correspondingParameter: <testLibraryFragment>::@extensionType::A::@constructor::new::@parameter::it#element
687687
staticType: int
688688
rightParenthesis: )
689-
element2: <testLibrary>::@extensionType::A::@constructor::A
689+
element2: <testLibrary>::@extensionType::A::@constructor::new
690690
''');
691691

692692
_assertAnnotationValueText(node, r'''

pkg/analyzer/test/src/summary/elements/class_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11692,7 +11692,7 @@ library
1169211692
reference: <testLibrary>::@extensionType::B
1169311693
firstFragment: <testLibraryFragment>::@extensionType::B
1169411694
representation: <testLibrary>::@extensionType::B::@field::it
11695-
primaryConstructor: <testLibrary>::@extensionType::B::@constructor::B
11695+
primaryConstructor: <testLibrary>::@extensionType::B::@constructor::new
1169611696
typeErasure: int
1169711697
fields
1169811698
final it
@@ -13321,7 +13321,7 @@ library
1332113321
reference: <testLibrary>::@extensionType::B
1332213322
firstFragment: <testLibraryFragment>::@extensionType::B
1332313323
representation: <testLibrary>::@extensionType::B::@field::it
13324-
primaryConstructor: <testLibrary>::@extensionType::B::@constructor::B
13324+
primaryConstructor: <testLibrary>::@extensionType::B::@constructor::new
1332513325
typeErasure: int
1332613326
fields
1332713327
final it
@@ -16668,7 +16668,7 @@ library
1666816668
reference: <testLibrary>::@extensionType::A
1666916669
firstFragment: <testLibraryFragment>::@extensionType::A
1667016670
representation: <testLibrary>::@extensionType::A::@field::it
16671-
primaryConstructor: <testLibrary>::@extensionType::A::@constructor::A
16671+
primaryConstructor: <testLibrary>::@extensionType::A::@constructor::new
1667216672
typeErasure: int
1667316673
fields
1667416674
final it

pkg/analyzer/test/src/summary/elements/duplicate_declaration_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ library
920920
constructors
921921
new
922922
reference: <testLibraryFragment>::@extensionType::E::@def::0::@constructor::new
923-
element: <testLibrary>::@extensionType::E::@def::0::@constructor::E
923+
element: <testLibrary>::@extensionType::E::@def::0::@constructor::new
924924
typeName: E
925925
typeNameOffset: 15
926926
formalParameters
@@ -941,7 +941,7 @@ library
941941
constructors
942942
new
943943
reference: <testLibraryFragment>::@extensionType::E::@def::1::@constructor::new
944-
element: <testLibrary>::@extensionType::E::@def::1::@constructor::E
944+
element: <testLibrary>::@extensionType::E::@def::1::@constructor::new
945945
typeName: E
946946
typeNameOffset: 43
947947
formalParameters
@@ -956,7 +956,7 @@ library
956956
reference: <testLibrary>::@extensionType::E::@def::0
957957
firstFragment: <testLibraryFragment>::@extensionType::E::@def::0
958958
representation: <testLibrary>::@extensionType::E::@def::0::@field::it
959-
primaryConstructor: <testLibrary>::@extensionType::E::@def::0::@constructor::E
959+
primaryConstructor: <testLibrary>::@extensionType::E::@def::0::@constructor::new
960960
typeErasure: int
961961
fields
962962
final it
@@ -977,7 +977,7 @@ library
977977
reference: <testLibrary>::@extensionType::E::@def::1
978978
firstFragment: <testLibraryFragment>::@extensionType::E::@def::1
979979
representation: <testLibrary>::@extensionType::E::@def::1::@field::it
980-
primaryConstructor: <testLibrary>::@extensionType::E::@def::1::@constructor::E
980+
primaryConstructor: <testLibrary>::@extensionType::E::@def::1::@constructor::new
981981
typeErasure: double
982982
fields
983983
final it

pkg/analyzer/test/src/summary/elements/enum_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2584,7 +2584,7 @@ library
25842584
reference: <testLibrary>::@extensionType::B
25852585
firstFragment: <testLibraryFragment>::@extensionType::B
25862586
representation: <testLibrary>::@extensionType::B::@field::it
2587-
primaryConstructor: <testLibrary>::@extensionType::B::@constructor::B
2587+
primaryConstructor: <testLibrary>::@extensionType::B::@constructor::new
25882588
typeErasure: int
25892589
fields
25902590
final it
@@ -3390,7 +3390,7 @@ library
33903390
reference: <testLibrary>::@extensionType::B
33913391
firstFragment: <testLibraryFragment>::@extensionType::B
33923392
representation: <testLibrary>::@extensionType::B::@field::it
3393-
primaryConstructor: <testLibrary>::@extensionType::B::@constructor::B
3393+
primaryConstructor: <testLibrary>::@extensionType::B::@constructor::new
33943394
typeErasure: int
33953395
fields
33963396
final it

0 commit comments

Comments
 (0)