mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 10:49:00 +00:00
prefer_const_literals_to_create_immutables
extension type test
Closes: https://github.com/dart-lang/linter/issues/4722 Change-Id: Ifd60ab27242e802638c072e5957c5c35fe89c399 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323682 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Phil Quitslund <pquitslund@google.com>
This commit is contained in:
parent
565919a80f
commit
039640fad1
1 changed files with 13 additions and 0 deletions
|
@ -20,6 +20,19 @@ class PreferConstLiteralsToCreateImmutablesTest extends LintRuleTest {
|
|||
@override
|
||||
String get lintRule => 'prefer_const_literals_to_create_immutables';
|
||||
|
||||
test_extensionType() async {
|
||||
await assertDiagnostics(r'''
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
@immutable
|
||||
extension type E(List<int> i) { }
|
||||
|
||||
var e = E([1]);
|
||||
''', [
|
||||
lint(90, 3),
|
||||
]);
|
||||
}
|
||||
|
||||
test_missingRequiredArgument() async {
|
||||
await assertDiagnostics(r'''
|
||||
import 'package:meta/meta.dart';
|
||||
|
|
Loading…
Reference in a new issue