mirror of
https://github.com/dart-lang/sdk
synced 2024-09-06 00:59:09 +00:00
Store invalid deferred types used in bodies.
R=brianwilkerson@google.com, paulberry@google.com Change-Id: Id9f6309b5a9af69d38305c538bacb967c4565793 Reviewed-on: https://dart-review.googlesource.com/67688 Commit-Queue: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Paul Berry <paulberry@google.com>
This commit is contained in:
parent
89cfa2edd7
commit
4b07df24dd
|
@ -569,18 +569,6 @@ class StaticWarningCodeTest_Kernel extends StaticWarningCodeTest_Driver {
|
|||
return super.test_switchExpressionNotAssignable();
|
||||
}
|
||||
|
||||
@override
|
||||
@failingTest
|
||||
test_typeAnnotationDeferredClass_asExpression() {
|
||||
return super.test_typeAnnotationDeferredClass_asExpression();
|
||||
}
|
||||
|
||||
@override
|
||||
@failingTest
|
||||
test_typeAnnotationDeferredClass_catchClause() {
|
||||
return super.test_typeAnnotationDeferredClass_catchClause();
|
||||
}
|
||||
|
||||
@override
|
||||
@failingTest
|
||||
test_typeAnnotationDeferredClass_functionDeclaration_returnType() async {
|
||||
|
@ -588,12 +576,6 @@ class StaticWarningCodeTest_Kernel extends StaticWarningCodeTest_Driver {
|
|||
.test_typeAnnotationDeferredClass_functionDeclaration_returnType();
|
||||
}
|
||||
|
||||
@override
|
||||
@failingTest
|
||||
test_typeAnnotationDeferredClass_isExpression() {
|
||||
return super.test_typeAnnotationDeferredClass_isExpression();
|
||||
}
|
||||
|
||||
@override
|
||||
@failingTest
|
||||
test_typeAnnotationDeferredClass_methodDeclaration_returnType() async {
|
||||
|
|
|
@ -3815,6 +3815,26 @@ class A {
|
|||
assertType(aRef, 'int');
|
||||
}
|
||||
|
||||
test_invalid_deferred_type_localVariable() async {
|
||||
addTestFile(r'''
|
||||
import 'dart:async' deferred as a;
|
||||
|
||||
main() {
|
||||
a.Future<int> v;
|
||||
}
|
||||
''');
|
||||
await resolveTestFile();
|
||||
expect(result.errors, isNotEmpty);
|
||||
|
||||
assertTypeName(
|
||||
findNode.typeName('a.Future'),
|
||||
futureElement,
|
||||
'Future<int>',
|
||||
expectedPrefix: findElement.import('dart:async').prefix,
|
||||
);
|
||||
assertTypeName(findNode.typeName('int>'), intElement, 'int');
|
||||
}
|
||||
|
||||
test_invalid_fieldInitializer_field() async {
|
||||
addTestFile(r'''
|
||||
class C {
|
||||
|
|
|
@ -528,7 +528,8 @@ abstract class DeferredAccessGenerator implements Generator {
|
|||
helper.addProblem(
|
||||
templateDeferredTypeAnnotation.withArguments(
|
||||
suffixGenerator.buildTypeWithBuiltArguments(arguments,
|
||||
nonInstanceAccessIsError: nonInstanceAccessIsError),
|
||||
nonInstanceAccessIsError: nonInstanceAccessIsError,
|
||||
typeInferrer: typeInferrer),
|
||||
prefixGenerator.plainNameForRead),
|
||||
offsetForToken(prefixGenerator.token),
|
||||
lengthOfSpan(prefixGenerator.token, token));
|
||||
|
|
Loading…
Reference in a new issue