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

Side by Side Diff: pkg/compiler/lib/src/resolution/send_structure.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dart2js.send_structure; 5 library dart2js.send_structure;
6 6
7 import 'access_semantics.dart'; 7 import 'access_semantics.dart';
8 import 'operators.dart'; 8 import 'operators.dart';
9 import 'semantic_visitor.dart'; 9 import 'semantic_visitor.dart';
10 import '../dart_types.dart'; 10 import '../dart_types.dart';
(...skipping 1919 matching lines...) Expand 10 before | Expand all | Expand 10 after
1930 return visitor.visitFactoryConstructorInvoke( 1930 return visitor.visitFactoryConstructorInvoke(
1931 node, semantics.element, semantics.type, 1931 node, semantics.element, semantics.type,
1932 node.send.argumentsNode, callStructure, arg); 1932 node.send.argumentsNode, callStructure, arg);
1933 case ConstructorAccessKind.REDIRECTING_FACTORY: 1933 case ConstructorAccessKind.REDIRECTING_FACTORY:
1934 return visitor.visitRedirectingFactoryConstructorInvoke( 1934 return visitor.visitRedirectingFactoryConstructorInvoke(
1935 node, semantics.element, semantics.type, 1935 node, semantics.element, semantics.type,
1936 semantics.effectiveTargetSemantics.element, 1936 semantics.effectiveTargetSemantics.element,
1937 semantics.effectiveTargetSemantics.type, 1937 semantics.effectiveTargetSemantics.type,
1938 node.send.argumentsNode, callStructure, arg); 1938 node.send.argumentsNode, callStructure, arg);
1939 case ConstructorAccessKind.ABSTRACT: 1939 case ConstructorAccessKind.ABSTRACT:
1940 return visitor.errorAbstractClassConstructorInvoke( 1940 return visitor.visitAbstractClassConstructorInvoke(
1941 node, semantics.element, semantics.type, 1941 node, semantics.element, semantics.type,
1942 node.send.argumentsNode, callStructure, arg); 1942 node.send.argumentsNode, callStructure, arg);
1943 case ConstructorAccessKind.ERRONEOUS: 1943 case ConstructorAccessKind.UNRESOLVED_CONSTRUCTOR:
1944 return visitor.errorUnresolvedConstructorInvoke( 1944 return visitor.visitUnresolvedConstructorInvoke(
1945 node, semantics.element, semantics.type, 1945 node, semantics.element, semantics.type,
1946 node.send.argumentsNode, selector, arg); 1946 node.send.argumentsNode, selector, arg);
1947 case ConstructorAccessKind.ERRONEOUS_REDIRECTING_FACTORY: 1947 case ConstructorAccessKind.UNRESOLVED_TYPE:
1948 return visitor.errorUnresolvedRedirectingFactoryConstructorInvoke( 1948 return visitor.visitUnresolvedClassConstructorInvoke(
1949 node, semantics.element, semantics.type, 1949 node, semantics.element, semantics.type,
1950 node.send.argumentsNode, selector, arg); 1950 node.send.argumentsNode, selector, arg);
1951 case ConstructorAccessKind.NON_CONSTANT_CONSTRUCTOR:
1952 return visitor.errorNonConstantConstructorInvoke(
1953 node, semantics.element, semantics.type,
1954 node.send.argumentsNode, callStructure, arg);
1955 case ConstructorAccessKind.ERRONEOUS_REDIRECTING_FACTORY:
1956 return visitor.visitUnresolvedRedirectingFactoryConstructorInvoke(
1957 node, semantics.element, semantics.type,
1958 node.send.argumentsNode, callStructure, arg);
1951 } 1959 }
1952 throw new SpannableAssertionFailure(node, 1960 throw new SpannableAssertionFailure(node,
1953 "Unhandled constructor invocation kind: ${semantics.kind}"); 1961 "Unhandled constructor invocation kind: ${semantics.kind}");
1954 } 1962 }
1955 } 1963 }
1956 1964
1957 /// The structure for a [NewExpression] of a constant invocation. For instance 1965 /// The structure for a [NewExpression] of a constant invocation. For instance
1958 /// `const C()`. 1966 /// `const C()`.
1959 class ConstInvokeStructure<R, A> extends NewStructure<R, A> { 1967 class ConstInvokeStructure<R, A> extends NewStructure<R, A> {
1960 final ConstructedConstantExpression constant; 1968 final ConstructedConstantExpression constant;
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
2162 final ConstructorElement constructor; 2170 final ConstructorElement constructor;
2163 final Selector selector; 2171 final Selector selector;
2164 2172
2165 ThisConstructorInvokeStructure(this.constructor, this.selector); 2173 ThisConstructorInvokeStructure(this.constructor, this.selector);
2166 2174
2167 R dispatch(SemanticDeclarationVisitor<R, A> visitor, Send node, A arg) { 2175 R dispatch(SemanticDeclarationVisitor<R, A> visitor, Send node, A arg) {
2168 return visitor.visitThisConstructorInvoke( 2176 return visitor.visitThisConstructorInvoke(
2169 node, constructor, node.argumentsNode, selector, arg); 2177 node, constructor, node.argumentsNode, selector, arg);
2170 } 2178 }
2171 } 2179 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/send_resolver.dart ('k') | tests/compiler/dart2js/semantic_visitor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698