Fix for resynthesizing invalid elements as type arguments of declared types.

Reproduced using Brian's stress test.

R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2662983005 .
This commit is contained in:
Konstantin Shcheglov 2017-01-31 14:28:31 -08:00
parent bcfa7e9ad2
commit 54c8496a38
2 changed files with 11 additions and 1 deletions

View file

@ -1625,7 +1625,8 @@ class _UnitResynthesizer {
} else {
DartType getTypeArgument(int i) {
if (i < type.typeArguments.length) {
return buildType(type.typeArguments[i], typeParameterContext);
return buildType(type.typeArguments[i], typeParameterContext,
declaredType: declaredType);
} else {
return DynamicTypeImpl.instance;
}

View file

@ -4679,6 +4679,15 @@ int V = 0;
allowErrors: true);
}
test_type_invalid_topLevelVariableElement_asTypeArgument() {
checkLibrary(
'''
var V;
static List<V> V2;
''',
allowErrors: true);
}
test_type_invalid_typeParameter_asPrefix() {
checkLibrary(
'''