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

Unified Diff: pkg/compiler/lib/src/typechecker.dart

Issue 938173004: Small fixes in preparation for SemanticVisitor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | « pkg/compiler/lib/src/elements/modelx.dart ('k') | tests/compiler/dart2js/analyze_unused_dart2js_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/typechecker.dart
diff --git a/pkg/compiler/lib/src/typechecker.dart b/pkg/compiler/lib/src/typechecker.dart
index 6bec813294af53a34cb635c74c37ab62e17ae22c..321be259fb0d988adbae38aa76c70add76dcf12f 100644
--- a/pkg/compiler/lib/src/typechecker.dart
+++ b/pkg/compiler/lib/src/typechecker.dart
@@ -47,6 +47,8 @@ class MemberKind {
abstract class ElementAccess {
Element get element;
+ String get name => element.name;
+
DartType computeType(Compiler compiler);
/// Returns [: true :] if the element can be access as an invocation.
@@ -82,6 +84,8 @@ class DynamicAccess implements ElementAccess {
Element get element => null;
+ String get name => 'dynamic';
+
DartType computeType(Compiler compiler) => const DynamicType();
bool isCallable(Compiler compiler) => true;
@@ -95,6 +99,8 @@ class AssertAccess implements ElementAccess {
Element get element => null;
+ String get name => 'assert';
+
DartType computeType(Compiler compiler) {
return new FunctionType.synthesized(
const VoidType(),
@@ -181,6 +187,8 @@ class TypeLiteralAccess extends ElementAccess {
Element get element => type.element;
+ String get name => type.name;
+
DartType computeType(Compiler compiler) => compiler.typeClass.rawType;
String toString() => 'TypeLiteralAccess($type)';
@@ -194,6 +202,8 @@ class FunctionCallAccess implements ElementAccess {
const FunctionCallAccess(this.element, this.type);
+ String get name => 'call';
+
DartType computeType(Compiler compiler) => type;
bool isCallable(Compiler compiler) => true;
@@ -931,7 +941,7 @@ class TypeCheckerVisitor extends Visitor<DartType> {
analyzeArguments(node, elementAccess.element, type, argumentTypes);
} else {
reportTypeWarning(node, MessageKind.NOT_CALLABLE,
- {'elementName': elementAccess.element.name});
+ {'elementName': elementAccess.name});
analyzeArguments(node, elementAccess.element, const DynamicType(),
argumentTypes);
}
« no previous file with comments | « pkg/compiler/lib/src/elements/modelx.dart ('k') | tests/compiler/dart2js/analyze_unused_dart2js_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698