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

Unified Diff: pkg/compiler/lib/src/resolution/semantic_visitor.dart

Issue 1130773002: Differentiate between unresolved class and constructor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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
Index: pkg/compiler/lib/src/resolution/semantic_visitor.dart
diff --git a/pkg/compiler/lib/src/resolution/semantic_visitor.dart b/pkg/compiler/lib/src/resolution/semantic_visitor.dart
index b626bba589838d6e7b5293cbdb5e34faa5d858ed..05cdfa2257b064675cebb53200550c2daae16d2f 100644
--- a/pkg/compiler/lib/src/resolution/semantic_visitor.dart
+++ b/pkg/compiler/lib/src/resolution/semantic_visitor.dart
@@ -5,7 +5,7 @@
library dart2js.semantics_visitor;
import '../constants/expressions.dart';
-import '../dart2jslib.dart' show invariant;
+import '../dart2jslib.dart' show invariant, MessageKind;
import '../dart_types.dart';
import '../elements/elements.dart';
import '../helpers/helpers.dart';
@@ -3028,9 +3028,9 @@ abstract class SemanticSendVisitor<R, A> {
///
/// where [type] is `C<int>`.
///
- // TODO(johnniwinther): Update [type] to be [InterfaceType] when this is no
- // longer a catch-all clause for the erroneous constructor invocations.
- R errorUnresolvedConstructorInvoke(
+ // TODO(johnniwinther): Change [type] to [InterfaceType] when is it not
+ // `dynamic`.
+ R visitUnresolvedConstructorInvoke(
NewExpression node,
Element constructor,
DartType type,
@@ -3045,7 +3045,9 @@ abstract class SemanticSendVisitor<R, A> {
///
/// where [type] is the malformed type `Unresolved`.
///
- R errorUnresolvedClassConstructorInvoke(
+ // TODO(johnniwinther): Change [type] to [MalformedType] when is it not
+ // `dynamic`.
+ R visitUnresolvedClassConstructorInvoke(
NewExpression node,
Element element,
MalformedType type,
@@ -3053,6 +3055,22 @@ abstract class SemanticSendVisitor<R, A> {
Selector selector,
A arg);
+ /// Constant invocation of a non-constant constructor.
+ ///
+ /// For instance
+ /// class C {
+ /// C(a, b);
+ /// }
+ /// m() => const C(true, 42);
+ ///
+ R errorNonConstantConstructorInvoke(
+ NewExpression node,
+ Element element,
+ InterfaceType type,
+ NodeList arguments,
+ CallStructure callStructure,
+ A arg);
+
/// Invocation of a constructor on an abstract [type] with [arguments].
///
/// For instance
@@ -3060,7 +3078,7 @@ abstract class SemanticSendVisitor<R, A> {
///
/// where [type] is the malformed type `Unresolved`.
///
- R errorAbstractClassConstructorInvoke(
+ R visitAbstractClassConstructorInvoke(
NewExpression node,
ConstructorElement element,
InterfaceType type,
@@ -3080,12 +3098,12 @@ abstract class SemanticSendVisitor<R, A> {
/// m1() => new C(true, 42);
/// m2() => new C.a(true, 42);
///
- R errorUnresolvedRedirectingFactoryConstructorInvoke(
+ R visitUnresolvedRedirectingFactoryConstructorInvoke(
NewExpression node,
ConstructorElement constructor,
InterfaceType type,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg);
}
« no previous file with comments | « pkg/compiler/lib/src/resolution/access_semantics.dart ('k') | pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698