Skip to content

Commit 2e1457e

Browse files
committed
Add a few more cases and update analyzer version
1 parent 895855a commit 2e1457e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ environment:
77
sdk: '>=2.11.99 <3.0.0'
88

99
dependencies:
10-
analyzer: ^2.1.0
10+
analyzer: ^2.2.0
1111
args: ^2.0.0
1212
charcode: ^1.2.0
1313
collection: ^1.2.0

test/end2end/model_special_cases_test.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,17 @@ void main() {
216216
});
217217

218218
test('negative tests', () {
219+
// Mixins do not have constructors.
219220
expect(referenceLookup(constructorTearoffs, 'M.new'),
220221
equals(MatchingLinkResult(null)));
222+
// These things aren't expressions, parentheses are still illegal.
223+
expect(referenceLookup(constructorTearoffs, '(C).new'),
224+
equals(MatchingLinkResult(null)));
225+
226+
// A bare new will still not work to reference constructors.
227+
// TODO(jcollins-g): reconsider this if we remove "new" as a hint.
228+
expect(referenceLookup(A, 'new'), equals(MatchingLinkResult(null)));
229+
expect(referenceLookup(At, 'new'), equals(MatchingLinkResult(null)));
221230
});
222231
}, skip: !_constructorTearoffsAllowed.allows(utils.platformVersion));
223232
});

0 commit comments

Comments
 (0)