Chromium Code Reviews| Index: pkg/analyzer/test/src/summary/summary_common.dart |
| diff --git a/pkg/analyzer/test/src/summary/summary_common.dart b/pkg/analyzer/test/src/summary/summary_common.dart |
| index ecacfe5de588e699616885e0840e3574ad13a2d5..9837d7ab0ffdd31c22974cfc0d2daa9de613aa4d 100644 |
| --- a/pkg/analyzer/test/src/summary/summary_common.dart |
| +++ b/pkg/analyzer/test/src/summary/summary_common.dart |
| @@ -1969,6 +1969,77 @@ const v = const p.C(); |
| ]); |
| } |
| + test_constExpr_invokeConstructor_unresolved_named() { |
|
Paul Berry
2016/02/16 20:44:10
Also make a version of this test where class C is
scheglov
2016/02/16 21:48:44
Done.
|
| + UnlinkedVariable variable = serializeVariableText( |
| + ''' |
| +class C {} |
| +const v = const C.foo(); |
| +''', |
| + allowErrors: true); |
| + _assertUnlinkedConst(variable.constExpr, operators: [ |
| + UnlinkedConstOperation.invokeConstructor, |
| + ], ints: [ |
| + 0, |
| + 0 |
| + ], referenceValidators: [ |
| + (EntityRef r) => checkTypeRef(r, null, null, 'foo', |
| + expectedKind: ReferenceKind.unresolved, |
| + checkAstDerivedDataOverride: true, |
| + prefixExpectations: [ |
| + new _PrefixExpectation(ReferenceKind.classOrEnum, 'C') |
| + ]) |
| + ]); |
| + } |
| + |
| + test_constExpr_invokeConstructor_unresolved_named_prefixed() { |
|
Paul Berry
2016/02/16 20:44:10
Also make a version of this test where class C is
scheglov
2016/02/16 21:48:44
Done.
|
| + addNamedSource( |
| + '/a.dart', |
| + ''' |
| +class C { |
| +} |
| +'''); |
| + UnlinkedVariable variable = serializeVariableText( |
| + ''' |
| +import 'a.dart' as p; |
| +const v = const p.C.foo(); |
| +''', |
| + allowErrors: true); |
| + _assertUnlinkedConst(variable.constExpr, operators: [ |
| + UnlinkedConstOperation.invokeConstructor, |
| + ], ints: [ |
| + 0, |
| + 0 |
| + ], referenceValidators: [ |
| + (EntityRef r) => checkTypeRef(r, null, null, 'foo', |
| + expectedKind: ReferenceKind.unresolved, |
| + checkAstDerivedDataOverride: true, |
| + prefixExpectations: [ |
| + new _PrefixExpectation(ReferenceKind.classOrEnum, 'C', |
| + absoluteUri: absUri('/a.dart'), relativeUri: 'a.dart'), |
| + new _PrefixExpectation(ReferenceKind.prefix, 'p', |
| + inLibraryDefiningUnit: true) |
| + ]) |
| + ]); |
| + } |
| + |
| + test_constExpr_invokeConstructor_unresolved_unnamed() { |
| + UnlinkedVariable variable = serializeVariableText( |
| + ''' |
| +const v = const Foo(); |
| +''', |
| + allowErrors: true); |
| + _assertUnlinkedConst(variable.constExpr, operators: [ |
| + UnlinkedConstOperation.invokeConstructor, |
| + ], ints: [ |
| + 0, |
| + 0 |
| + ], referenceValidators: [ |
| + (EntityRef r) => checkTypeRef(r, null, null, 'Foo', |
| + expectedKind: ReferenceKind.unresolved, |
| + checkAstDerivedDataOverride: true) |
| + ]); |
| + } |
| + |
| test_constExpr_length_classConstField() { |
| UnlinkedVariable variable = serializeVariableText(''' |
| class C { |