Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Unified Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 23541003: Fix crash in compiler in the presence of "new library_prefix()". (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/language/new_prefix_test.dart » ('j') | tests/language/new_prefix_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/resolution/members.dart (revision 26685)
+++ sdk/lib/_internal/compiler/implementation/resolution/members.dart (working copy)
@@ -4012,11 +4012,17 @@
Node expression) {
// Find the unnamed constructor if the reference resolved to a
// class.
- if (!Elements.isUnresolved(e) && e.isClass()) {
- ClassElement cls = e;
- cls.ensureResolved(compiler);
- // The unnamed constructor may not exist, so [e] may become unresolved.
- e = lookupConstructor(cls, diagnosticNode, const SourceString(''));
+ if (!Elements.isUnresolved(e) && !e.isConstructor()) {
+ if (e.isClass()) {
+ ClassElement cls = e;
+ cls.ensureResolved(compiler);
+ // The unnamed constructor may not exist, so [e] may become unresolved.
+ e = lookupConstructor(cls, diagnosticNode, const SourceString(''));
+ } else {
+ error(diagnosticNode,
+ MessageKind.NOT_A_TYPE.error,
+ {'node': diagnosticNode});
+ }
}
if (type == null) {
if (Elements.isUnresolved(e)) {
« no previous file with comments | « no previous file | tests/language/new_prefix_test.dart » ('j') | tests/language/new_prefix_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698