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

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

Issue 2567133002: Add support for the new function-type syntax. (Closed)
Patch Set: Update status files and update test-generator for checked mode. Created 4 years 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..8875e1562fb0a2d81c037af8af930652d06a965e 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,12 @@ 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) {
Siggi Cherem (dart-lang) 2016/12/29 22:46:57 long line (we just run dartfmt before submitting)
floitsch 2016/12/30 14:55:47 done. didn't know that dartfmt was accepted in dar
Siggi Cherem (dart-lang) 2017/01/03 23:23:54 :)
+ DartType supertype = resolveNominalType(superclass);
if (supertype != null) {
if (supertype.isMalformed) {
reporter.reportErrorMessage(
@@ -471,7 +471,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 +485,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 +610,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