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

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

Issue 2567133002: Add support for the new function-type syntax. (Closed)
Patch Set: Fixes after rebase. Created 3 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
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 c260b9962c3e0b960b178a15a1a077383284df7e..50b021cae0543cf994bf86aed105c1f53802c3db 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<ResolutionDartType> {
TypeVariableElementX variableElement = typeVariable.element;
if (typeNode.bound != null) {
- ResolutionDartType boundType =
- typeResolver.resolveTypeAnnotation(this, typeNode.bound);
+ ResolutionDartType 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.
- ResolutionDartType checkMixinType(TypeAnnotation mixinNode) {
- ResolutionDartType mixinType = resolveType(mixinNode);
+ ResolutionDartType checkMixinType(NominalTypeAnnotation mixinNode) {
+ ResolutionDartType mixinType = resolveNominalType(mixinNode);
if (isBlackListed(mixinType)) {
reporter.reportErrorMessage(
mixinNode, MessageKind.CANNOT_MIXIN, {'type': mixinType});
@@ -440,13 +440,13 @@ class ClassResolverVisitor extends TypeDefinitionVisitor {
return mixinType;
}
- ResolutionDartType resolveType(TypeAnnotation node) {
- return typeResolver.resolveTypeAnnotation(this, node);
+ ResolutionDartType resolveNominalType(NominalTypeAnnotation node) {
+ return typeResolver.resolveNominalTypeAnnotation(this, node, const []);
}
ResolutionDartType resolveSupertype(
- ClassElement cls, TypeAnnotation superclass) {
- ResolutionDartType supertype = resolveType(superclass);
+ ClassElement cls, NominalTypeAnnotation superclass) {
+ ResolutionDartType supertype = resolveNominalType(superclass);
if (supertype != null) {
if (supertype.isMalformed) {
reporter.reportErrorMessage(
@@ -476,7 +476,7 @@ class ClassResolverVisitor extends TypeDefinitionVisitor {
Link<ResolutionDartType> result = const Link<ResolutionDartType>();
if (interfaces == null) return result;
for (Link<Node> link = interfaces.nodes; !link.isEmpty; link = link.tail) {
- ResolutionDartType interfaceType = resolveType(link.head);
+ ResolutionDartType interfaceType = resolveNominalType(link.head);
if (interfaceType != null) {
if (interfaceType.isMalformed) {
reporter.reportErrorMessage(
@@ -490,7 +490,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 {
@@ -615,7 +615,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