Skip to content

Commit 7660eaa

Browse files
authored
Revert support for constructor tear-offs and republish as 2.1.1. (#1058)
This enables pub to avoid selecting 2.1.0, which has a bad constraint on analyzer (#1051).
1 parent 14d9b6f commit 7660eaa

File tree

8 files changed

+10
-75
lines changed

8 files changed

+10
-75
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 2.1.1
2+
3+
* Republish 2.0.3 as 2.1.1 in order to avoid users getting 2.1.0, which has a
4+
bad dependency constraint (#1051).
5+
16
# 2.1.0
27

38
* Support generic function references and constructor tear-offs (#1028).

lib/src/cli/formatter_options.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import 'show.dart';
1313
import 'summary.dart';
1414

1515
// Note: The following line of code is modified by tool/grind.dart.
16-
const dartStyleVersion = '2.1.0';
16+
const dartStyleVersion = '2.1.1';
1717

1818
/// Global options that affect how the formatter produces and uses its outputs.
1919
class FormatterOptions {

lib/src/dart_formatter.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ class DartFormatter {
8989
var featureSet = FeatureSet.fromEnableFlags2(
9090
sdkLanguageVersion: Version(2, 13, 0),
9191
flags: [
92-
'constructor-tearoffs',
9392
'generic-metadata',
9493
'nonfunction-type-aliases',
9594
'triple-shift'

lib/src/source_visitor.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1805,12 +1805,6 @@ class SourceVisitor extends ThrowingAstVisitor {
18051805
builder.endSpan();
18061806
}
18071807

1808-
@override
1809-
void visitFunctionReference(FunctionReference node) {
1810-
visit(node.function);
1811-
visit(node.typeArguments);
1812-
}
1813-
18141808
@override
18151809
void visitFunctionTypeAlias(FunctionTypeAlias node) {
18161810
visitMetadata(node.metadata);

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: dart_style
22
# Note: See tool/grind.dart for how to bump the version.
3-
version: 2.1.0
3+
version: 2.1.1
44
description: >-
55
Opinionated, automatic Dart source code formatter.
66
Provides an API and a CLI tool.

test/splitting/mixed.stmt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,4 @@ var longVariableName = identifierSoLongItWraps is SomeClassName;
222222
<<<
223223
var longVariableName =
224224
identifierSoLongItWraps
225-
is SomeClassName;
226-
>>> generic function reference nested inside expression
227-
veryLongFunction(argument, ConstructorTearOff<First, Second, Third, Fourth>, argument);
228-
<<<
229-
veryLongFunction(
230-
argument,
231-
ConstructorTearOff<First, Second,
232-
Third, Fourth>,
233-
argument);
225+
is SomeClassName;

test/splitting/type_arguments.stmt

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -94,43 +94,4 @@ new SomeClass<
9494
fifth,
9595
sixth,
9696
seventh,
97-
eighth);
98-
>>> generic instantiation all fit on one line
99-
Foo<A,B,C,D>;
100-
<<<
101-
Foo<A, B, C, D>;
102-
>>> generic instantiation split between args
103-
LongClassName<First, Second, Third, Fourth>;
104-
<<<
105-
LongClassName<First, Second, Third,
106-
Fourth>;
107-
>>> generic instantiation split before first if needed
108-
LongClassName<FirstTypeArgumentIsTooLong, Second>;
109-
<<<
110-
LongClassName<
111-
FirstTypeArgumentIsTooLong, Second>;
112-
>>> generic instantiation split in middle if fit in two lines
113-
LongClassName<First, Second, Third, Fourth, Fifth, Sixth, Seventh>;
114-
<<<
115-
LongClassName<First, Second, Third,
116-
Fourth, Fifth, Sixth, Seventh>;
117-
>>> generic instantiation split one per line if they don't fit in two lines
118-
LongClassName<First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth>;
119-
<<<
120-
LongClassName<
121-
First,
122-
Second,
123-
Third,
124-
Fourth,
125-
Fifth,
126-
Sixth,
127-
Seventh,
128-
Eighth>;
129-
>>> generic instantiation indent nested type arguments
130-
LongClassName<First, Inner<Second, Third, Fourth, Fifth, Sixth, Seventh>, Eighth>;
131-
<<<
132-
LongClassName<
133-
First,
134-
Inner<Second, Third, Fourth, Fifth,
135-
Sixth, Seventh>,
136-
Eighth>;
97+
eighth);

test/whitespace/expressions.stmt

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -170,20 +170,4 @@ obj?[foo];
170170
>>> generic function expression
171171
var generic = < T,S >(){};
172172
<<<
173-
var generic = <T, S>() {};
174-
>>> generic method instantiation
175-
void main() => id < int > ;
176-
<<<
177-
void main() => id<int>;
178-
>>> generic method instantiation
179-
void main() => id < int , String , bool > ;
180-
<<<
181-
void main() => id<int, String, bool>;
182-
>>> generic constructor tear-off
183-
var x = Class < int >;
184-
<<<
185-
var x = Class<int>;
186-
>>> generic name constructor tear-off
187-
var x = Class < int > . named;
188-
<<<
189-
var x = Class<int>.named;
173+
var generic = <T, S>() {};

0 commit comments

Comments
 (0)