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

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

Issue 2567133002: Add support for the new function-type syntax. (Closed)
Patch Set: Remove obsolete named argument. Created 3 years, 12 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/class_hierarchy.dart
diff --git a/pkg/compiler/lib/src/resolution/class_hierarchy.dart b/pkg/compiler/lib/src/resolution/class_hierarchy.dart
index 7f2a57a167544b612754b76034c704fd6c61c7da..46d63e63aa252577f3ab97524619a8d7a8bfed6d 100644
--- a/pkg/compiler/lib/src/resolution/class_hierarchy.dart
+++ b/pkg/compiler/lib/src/resolution/class_hierarchy.dart
@@ -66,8 +66,8 @@ class TypeDefinitionVisitor extends MappingVisitor<DartType> {
TypeVariableElementX variableElement = typeVariable.element;
if (typeNode.bound != null) {
- DartType boundType =
- typeResolver.resolveTypeAnnotation(this, typeNode.bound);
+ DartType boundType = typeResolver
+ .resolveNominalTypeAnnotation(this, typeNode.bound, const []);
variableElement.boundCache = boundType;
void checkTypeVariableBound() {
@@ -250,8 +250,8 @@ class ClassResolverVisitor extends TypeDefinitionVisitor {
/// Resolves the mixed type for [mixinNode] and checks that the mixin type
/// is a valid, non-blacklisted interface type. The mixin type is returned.
- DartType checkMixinType(TypeAnnotation mixinNode) {
- DartType mixinType = resolveType(mixinNode);
+ DartType checkMixinType(NominalTypeAnnotation mixinNode) {
+ DartType mixinType = resolveNominalType(mixinNode);
if (isBlackListed(mixinType)) {
reporter.reportErrorMessage(
mixinNode, MessageKind.CANNOT_MIXIN, {'type': mixinType});
@@ -437,12 +437,13 @@ class ClassResolverVisitor extends TypeDefinitionVisitor {
return mixinType;
}
- DartType resolveType(TypeAnnotation node) {
- return typeResolver.resolveTypeAnnotation(this, node);
+ DartType resolveNominalType(NominalTypeAnnotation node) {
+ return typeResolver.resolveNominalTypeAnnotation(this, node, const []);
}
- DartType resolveSupertype(ClassElement cls, TypeAnnotation superclass) {
- DartType supertype = resolveType(superclass);
+ DartType resolveSupertype(
+ ClassElement cls, NominalTypeAnnotation superclass) {
+ DartType supertype = resolveNominalType(superclass);
if (supertype != null) {
if (supertype.isMalformed) {
reporter.reportErrorMessage(
@@ -471,7 +472,7 @@ class ClassResolverVisitor extends TypeDefinitionVisitor {
Link<DartType> result = const Link<DartType>();
if (interfaces == null) return result;
for (Link<Node> link = interfaces.nodes; !link.isEmpty; link = link.tail) {
- DartType interfaceType = resolveType(link.head);
+ DartType interfaceType = resolveNominalType(link.head);
if (interfaceType != null) {
if (interfaceType.isMalformed) {
reporter.reportErrorMessage(
@@ -485,7 +486,7 @@ class ClassResolverVisitor extends TypeDefinitionVisitor {
{'className': element.name, 'enumType': interfaceType});
} else if (!interfaceType.isInterfaceType) {
// TODO(johnniwinther): Handle dynamic.
- TypeAnnotation typeAnnotation = link.head;
+ NominalTypeAnnotation typeAnnotation = link.head;
reporter.reportErrorMessage(
typeAnnotation.typeName, MessageKind.CLASS_NAME_EXPECTED);
} else {
@@ -610,7 +611,7 @@ class ClassSupertypeResolver extends CommonResolverVisitor {
visitNodeList(node.interfaces);
}
- void visitTypeAnnotation(TypeAnnotation node) {
+ void visitNominalTypeAnnotation(NominalTypeAnnotation node) {
node.typeName.accept(this);
}

Powered by Google App Engine
This is Rietveld 408576698