Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Commit 0a3b30e

Browse files
authored
Tests validating implicit const handling (#910). (#911)
See: #910.
1 parent d005260 commit 0a3b30e

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

analysis_options.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
analyzer:
22
strong-mode: true
3+
language:
4+
enablePreviewDart2: true
35
exclude:
46
# ignore vscode .history files
57
- .history/**

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ homepage: https://github.com/dart-lang/linter
66
environment:
77
sdk: '>=1.12.0 <2.0.0'
88
dependencies:
9-
analyzer: ^0.31.0-alpha.2
9+
analyzer: ^0.31.2-alpha.0
1010
args: '>=0.12.1 <2.0.0'
1111
glob: ^1.0.3
1212
meta: ^1.0.2

test/rules/prefer_const_constructors.dart

+9-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@
55
// test w/ `pub run test -N prefer_const_constructors`
66

77
class A {
8-
const A();
8+
const A({A parent});
9+
const A.a();
10+
}
11+
12+
void accessA_0() {
13+
A a = A(); //OK
14+
A a1 = A(
15+
parent: A.a(), //OK
16+
);
917
}
1018

1119
void accessA_1() {

0 commit comments

Comments
 (0)