Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit bf20abb

Browse files
author
Dart CI
committed
Version 2.12.0-40.0.dev
Merge commit 'ef07751c43a7bdf9c0f43430d041c1840b8f925c' into 'dev'
2 parents 8ca6fb1 + ef07751 commit bf20abb

Some content is hidden

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

42 files changed

+331
-468
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ This tracker is for issues related to:
77
* Dart core libraries ("dart:async", "dart:io", etc.)
88
* Dart VM
99
* dart2js
10-
* dartfix
1110
* dev_compiler
1211

1312
Some other pieces of the Dart ecosystem are maintained elsewhere. Please

BUILD.gn

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,6 @@ group("dartfmt") {
107107
deps = [ "utils/dartfmt" ]
108108
}
109109

110-
group("dartfix") {
111-
deps = [ "utils/dartfix" ]
112-
}
113-
114110
group("analysis_server") {
115111
deps = [ "utils/analysis_server" ]
116112
}

pkg/_js_interop_checks/lib/js_interop_checks.dart

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,17 @@ class JsInteropChecks extends RecursiveVisitor<void> {
170170

171171
/// Returns whether [member] is considered to be a JS interop member.
172172
bool _isJSInteropMember(Member member) {
173-
if (!member.isExternal) return false;
174-
if (_classHasJSAnnotation) return true;
175-
if (!_classHasJSAnnotation && member.enclosingClass != null) return false;
176-
// In the case where the member does not belong to any class, a JS
177-
// annotation is not needed on the library to be considered JS interop as
178-
// long as the member has an annotation.
179-
return hasJSInteropAnnotation(member) || _libraryHasJSAnnotation;
173+
if (member.isExternal) {
174+
if (_classHasJSAnnotation) return true;
175+
if (member.enclosingClass == null) {
176+
// In the case where the member does not belong to any class, a JS
177+
// annotation is not needed on the library to be considered JS interop
178+
// as long as the member has an annotation.
179+
return hasJSInteropAnnotation(member) || _libraryHasJSAnnotation;
180+
}
181+
}
182+
183+
// Otherwise, not JS interop.
184+
return false;
180185
}
181186
}

pkg/analyzer/lib/src/dart/ast/ast.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5423,6 +5423,11 @@ class GenericTypeAliasImpl extends TypeAliasImpl implements GenericTypeAlias {
54235423
@override
54245424
TypeAnnotation get type => _type;
54255425

5426+
/// Set the type being defined by the alias to the given [TypeAnnotation].
5427+
set type(TypeAnnotation typeAnnotation) {
5428+
_type = _becomeParentOf(typeAnnotation as TypeAnnotationImpl);
5429+
}
5430+
54265431
@override
54275432
TypeParameterList get typeParameters => _typeParameters;
54285433

pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ class ToSourceVisitor implements AstVisitor<void> {
668668
safelyVisitNode(node.name);
669669
safelyVisitNode(node.typeParameters);
670670
sink.write(" = ");
671-
safelyVisitNode(node.functionType);
671+
safelyVisitNode(node.type);
672672
}
673673

674674
@override

pkg/analyzer/lib/src/dart/ast/utilities.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ class AstCloner implements AstVisitor<AstNode> {
603603
cloneNode(node.name),
604604
cloneNode(node.typeParameters),
605605
cloneToken(node.equals),
606-
cloneNode(node.functionType),
606+
cloneNode(node.type),
607607
cloneToken(node.semicolon));
608608

609609
@override
@@ -1745,7 +1745,7 @@ class AstComparator implements AstVisitor<bool> {
17451745
isEqualNodes(node.name, other.name) &&
17461746
isEqualNodes(node.typeParameters, other.typeParameters) &&
17471747
isEqualTokens(node.equals, other.equals) &&
1748-
isEqualNodes(node.functionType, other.functionType);
1748+
isEqualNodes(node.type, other.type);
17491749
}
17501750

17511751
@override
@@ -3304,8 +3304,8 @@ class NodeReplacer implements AstVisitor<bool> {
33043304
} else if (identical(node.typeParameters, _oldNode)) {
33053305
node.typeParameters = _newNode as TypeParameterList;
33063306
return true;
3307-
} else if (identical(node.functionType, _oldNode)) {
3308-
node.functionType = _newNode as GenericFunctionType;
3307+
} else if (identical(node.type, _oldNode)) {
3308+
(node as GenericTypeAliasImpl).type = _newNode as TypeAnnotation;
33093309
return true;
33103310
} else if (_replaceInList(node.metadata)) {
33113311
return true;
@@ -4664,7 +4664,7 @@ class ResolutionCopier implements AstVisitor<bool> {
46644664
_isEqualNodes(node.name, toNode.name),
46654665
_isEqualNodes(node.typeParameters, toNode.typeParameters),
46664666
_isEqualTokens(node.equals, toNode.equals),
4667-
_isEqualNodes(node.functionType, toNode.functionType),
4667+
_isEqualNodes(node.type, toNode.type),
46684668
_isEqualTokens(node.semicolon, toNode.semicolon))) {
46694669
return true;
46704670
}

pkg/analyzer/lib/src/dart/resolver/resolution_visitor.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ class ResolutionVisitor extends RecursiveAstVisitor<void> {
726726
_withNameScope(() {
727727
_buildTypeParameterElements(node.typeParameters);
728728
node.typeParameters?.accept(this);
729-
node.functionType?.accept(this);
729+
node.type?.accept(this);
730730
});
731731
});
732732
}

pkg/analyzer/lib/src/fasta/ast_builder.dart

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,15 +1540,8 @@ class AstBuilder extends StackListener {
15401540
if (type is! GenericFunctionType && !enableNonFunctionTypeAliases) {
15411541
handleRecoverableError(messageTypedefNotFunction, equals, equals);
15421542
}
1543-
declarations.add(ast.genericTypeAlias(
1544-
comment,
1545-
metadata,
1546-
typedefKeyword,
1547-
name,
1548-
templateParameters,
1549-
equals,
1550-
type,
1551-
semicolon));
1543+
declarations.add(ast.genericTypeAlias(comment, metadata, typedefKeyword,
1544+
name, templateParameters, equals, type, semicolon));
15521545
}
15531546
}
15541547

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ class AstTextPrinter extends ThrowingAstVisitor<void> {
520520
node.name.accept(this);
521521
node.typeParameters?.accept(this);
522522
_token(node.equals);
523-
node.functionType.accept(this);
523+
node.type.accept(this);
524524
_token(node.semicolon);
525525
}
526526

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ class _SetInformativeId extends SimpleAstVisitor<void> {
263263
);
264264

265265
node.typeParameters?.accept(this);
266-
node.functionType?.accept(this);
266+
node.type?.accept(this);
267267
}
268268

269269
@override

0 commit comments

Comments
 (0)