Skip to content

Commit d0c6b1d

Browse files
authored
Fix a metadata test to not have whitespace before the "(". (#1154)
With records coming, we use whitespace there to disambiguate metadata annotation arguments from a subsequent record type annotation. There was a metadata formatting test whose before code had whitespace there and now will be interpreted differently (and erroneously) by the language. This fixes that test.
1 parent bc86574 commit d0c6b1d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
* Format unnamed libraries.
55
* Require Dart 2.18.
66
* Use typed `_visitFunctionOrMethodDeclaration` instead of dynamically typed.
7+
* Fix metadata test to not fail when record syntax makes whitespace between
8+
metadata annotation names and `(` significant ([sdk#50769][]).
9+
10+
[sdk#50769]: https://github.com/dart-lang/sdk/issues/50769
711

812
# 2.2.4
913

test/whitespace/metadata.unit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ class A {
280280
@foo
281281
typedef Fn = Function();
282282
>>> metadata on non-function typedef
283-
@foo typedef Hash< @a K, @b ( 1 ) V > = Map < K , V > ;
283+
@foo typedef Hash< @a K, @b( 1 ) V > = Map < K , V > ;
284284
<<<
285285
@foo
286286
typedef Hash<@a K, @b(1) V> = Map<K, V>;

0 commit comments

Comments
 (0)