This repository was archived by the owner on Nov 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
test_data/rules/experiments/constructor_tearoffs/rules Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ // Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
2+ // for details. All rights reserved. Use of this source code is governed by a
3+ // BSD-style license that can be found in the LICENSE file.
4+
5+ // test w/ `dart test -N unnecessary_const`
6+
7+ //ignore_for_file: unused_local_variable
8+
9+ class A {
10+ const A ([o]);
11+ }
12+
13+ main () {
14+ const A (); // OK
15+ A (); // OK
16+
17+ A .new (); // OK
18+ const A .new (); // OK
19+
20+ const A ([]); // OK
21+ A ([]); // OK
22+ A (const []); // OK
23+
24+ const A (A ()); // OK
25+ A (const A ()); // OK
26+ A (A ()); // OK
27+
28+ final v1 = A (); // OK
29+ const v3 = const A (); // LINT
30+ const v4 = A (); // OK
31+ final v5 = const A ([]); // OK
32+ const v6 = const A ([]); // LINT
33+ const v7 = A ([]); // OK
34+ final v8 = A (const []); // OK
35+ final v9 = const A (const []); // LINT
36+ final v10 = const A ([]); // OK
37+ final v11 = const A (const {}); // LINT
38+ final v12 = const A ({}); // OK
39+
40+ const v13 = const A .new (); // LINT
41+ final v14 = A .new (const []); // OK
42+ final v15 = const A .new (const []); // LINT
43+ }
You can’t perform that action at this time.
0 commit comments