Skip to content

Commit 08b0294

Browse files
authored
Merge pull request #1067 from scheglov/latestAnalyzer-NamedType
Require analyzer 2.6.0, use NamedType.
2 parents 96cca43 + ae3d7d3 commit 08b0294

File tree

4 files changed

+22
-20
lines changed

4 files changed

+22
-20
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# 2.2.1-dev
2+
* Require `package:analyzer` version `2.6.0`.
3+
* Use `NamedType` instead of `TypeName`.
24

35
# 2.2.0
46

lib/src/source_visitor.dart

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ class SourceVisitor extends ThrowingAstVisitor {
801801
token(node.equals);
802802
space();
803803

804-
visit(node.superclass);
804+
visit(node.superclass2);
805805

806806
builder.startRule(CombinatorRule());
807807
visit(node.withClause);
@@ -1067,7 +1067,7 @@ class SourceVisitor extends ThrowingAstVisitor {
10671067

10681068
@override
10691069
void visitConstructorName(ConstructorName node) {
1070-
visit(node.type);
1070+
visit(node.type2);
10711071
token(node.period);
10721072
visit(node.name);
10731073
}
@@ -1449,7 +1449,7 @@ class SourceVisitor extends ThrowingAstVisitor {
14491449
soloSplit();
14501450
token(node.extendsKeyword);
14511451
space();
1452-
visit(node.superclass);
1452+
visit(node.superclass2);
14531453
}
14541454

14551455
@override
@@ -2075,7 +2075,7 @@ class SourceVisitor extends ThrowingAstVisitor {
20752075

20762076
@override
20772077
void visitImplementsClause(ImplementsClause node) {
2078-
_visitCombinator(node.implementsKeyword, node.interfaces);
2078+
_visitCombinator(node.implementsKeyword, node.interfaces2);
20792079
}
20802080

20812081
@override
@@ -2340,18 +2340,18 @@ class SourceVisitor extends ThrowingAstVisitor {
23402340
// If there is only a single superclass constraint, format it like an
23412341
// "extends" in a class.
23422342
var onClause = node.onClause;
2343-
if (onClause != null && onClause.superclassConstraints.length == 1) {
2343+
if (onClause != null && onClause.superclassConstraints2.length == 1) {
23442344
soloSplit();
23452345
token(onClause.onKeyword);
23462346
space();
2347-
visit(onClause.superclassConstraints.single);
2347+
visit(onClause.superclassConstraints2.single);
23482348
}
23492349

23502350
builder.startRule(CombinatorRule());
23512351

23522352
// If there are multiple superclass constraints, format them like the
23532353
// "implements" clause.
2354-
if (onClause != null && onClause.superclassConstraints.length > 1) {
2354+
if (onClause != null && onClause.superclassConstraints2.length > 1) {
23552355
visit(onClause);
23562356
}
23572357

@@ -2371,6 +2371,13 @@ class SourceVisitor extends ThrowingAstVisitor {
23712371
visitNamedArgument(node);
23722372
}
23732373

2374+
@override
2375+
void visitNamedType(NamedType node) {
2376+
visit(node.name);
2377+
visit(node.typeArguments);
2378+
token(node.question);
2379+
}
2380+
23742381
@override
23752382
void visitNativeClause(NativeClause node) {
23762383
token(node.nativeKeyword);
@@ -2395,7 +2402,7 @@ class SourceVisitor extends ThrowingAstVisitor {
23952402

23962403
@override
23972404
void visitOnClause(OnClause node) {
2398-
_visitCombinator(node.onKeyword, node.superclassConstraints);
2405+
_visitCombinator(node.onKeyword, node.superclassConstraints2);
23992406
}
24002407

24012408
@override
@@ -2699,13 +2706,6 @@ class SourceVisitor extends ThrowingAstVisitor {
26992706
_visitGenericList(node.leftBracket, node.rightBracket, node.arguments);
27002707
}
27012708

2702-
@override
2703-
void visitTypeName(TypeName node) {
2704-
visit(node.name);
2705-
visit(node.typeArguments);
2706-
token(node.question);
2707-
}
2708-
27092709
@override
27102710
void visitTypeParameter(TypeParameter node) {
27112711
visitParameterMetadata(node.metadata, () {
@@ -2806,7 +2806,7 @@ class SourceVisitor extends ThrowingAstVisitor {
28062806

28072807
@override
28082808
void visitWithClause(WithClause node) {
2809-
_visitCombinator(node.withKeyword, node.mixinTypes);
2809+
_visitCombinator(node.withKeyword, node.mixinTypes2);
28102810
}
28112811

28122812
@override

pubspec.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ packages:
77
name: _fe_analyzer_shared
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "26.0.0"
10+
version: "29.0.0"
1111
analyzer:
1212
dependency: "direct main"
1313
description:
1414
name: analyzer
1515
url: "https://pub.dartlang.org"
1616
source: hosted
17-
version: "2.3.0"
17+
version: "2.6.0"
1818
args:
1919
dependency: "direct main"
2020
description:
@@ -366,4 +366,4 @@ packages:
366366
source: hosted
367367
version: "3.1.0"
368368
sdks:
369-
dart: ">=2.12.0 <3.0.0"
369+
dart: ">=2.14.0 <3.0.0"

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ environment:
1010
sdk: '>=2.12.0-0 <3.0.0'
1111

1212
dependencies:
13-
analyzer: '>=2.0.0 <3.0.0'
13+
analyzer: '>=2.6.0 <3.0.0'
1414
args: '>=1.0.0 <3.0.0'
1515
path: ^1.0.0
1616
pub_semver: '>=1.4.4 <3.0.0'

0 commit comments

Comments
 (0)