mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 22:31:50 +00:00
test to validate deferred elements can't be used in constant contexts
Change-Id: Iadc534f9f99943e60966e18867010a56df9065d3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/244281 Commit-Queue: Phil Quitslund <pquitslund@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
parent
e630a3adef
commit
b0f9470a83
|
@ -154,6 +154,29 @@ class CanBeConstInstanceCreationTest extends AbstractLinterContextTest {
|
|||
expect(context.canBeConst(node), expectedResult);
|
||||
}
|
||||
|
||||
@FailingTest(issue: 'https://github.com/dart-lang/linter/issues/3389')
|
||||
void test_deferred_argument() async {
|
||||
await resolveFileCode('$testPackageLibPath/a.dart', r'''
|
||||
class A {
|
||||
const A();
|
||||
}
|
||||
|
||||
const aa = A();
|
||||
''');
|
||||
await resolve(r'''
|
||||
import 'a.dart' deferred as a;
|
||||
|
||||
class B {
|
||||
const B(Object a);
|
||||
}
|
||||
|
||||
main() {
|
||||
print(B(a.aa));
|
||||
}
|
||||
''');
|
||||
assertCanBeConst('B(a.aa)', false);
|
||||
}
|
||||
|
||||
void test_false_argument_invocation() async {
|
||||
await resolve('''
|
||||
class A {}
|
||||
|
|
Loading…
Reference in a new issue