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

Unified Diff: sdk/lib/_internal/compiler/implementation/dart_types.dart

Issue 22903036: Use predicates to check simple function types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 7 years, 4 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 | « no previous file | sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/dart_types.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_types.dart b/sdk/lib/_internal/compiler/implementation/dart_types.dart
index f49028849b7759bee049eb9f94cc9defad44314b..f7a43851308fd8953e5de5e20ffc65a781a27a4c 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_types.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_types.dart
@@ -83,7 +83,7 @@ abstract class DartType {
/**
* If this type is malformed or a generic type created with the wrong number
* of type arguments then [userProvidedBadType] holds the bad type provided
- * by the user.
+ * by the user.
*/
DartType get userProvidedBadType => null;
@@ -105,7 +105,7 @@ abstract class DartType {
/// Returns an occurrence of a type variable within this type, if any.
TypeVariableType get typeVariableOccurrence => null;
- /// Applies [f] to each occurence of a [TypeVariableType] within this type.
+ /// Applies [f] to each occurence of a [TypeVariableType] within this type.
void forEachTypeVariable(f(TypeVariableType variable)) {}
TypeVariableType _findTypeVariableOccurrence(Link<DartType> types) {
@@ -487,10 +487,10 @@ class InterfaceType extends GenericType {
Element member = classElement.implementation.lookupLocalMember(name);
if (member == null) return null;
if (member.isConstructor() || member.isPrefix()) return null;
- assert(member.isFunction() ||
- member.isAbstractField() ||
+ assert(member.isFunction() ||
+ member.isAbstractField() ||
member.isField());
-
+
if (member.isAbstractField()) {
AbstractFieldElement abstractFieldElement = member;
if (fallbackAbstractField == null) {
@@ -505,7 +505,7 @@ class InterfaceType extends GenericType {
member = null;
}
}
- return member != null
+ return member != null
? new Member(receiver, declarer, member, isSetter: isSetter) : null;
}
@@ -544,7 +544,7 @@ class InterfaceType extends GenericType {
/**
* Special subclass of [InterfaceType] used for generic interface types created
* with the wrong number of type arguments.
- *
+ *
* The type uses [:dynamic:] for all it s type arguments.
*/
class BadInterfaceType extends InterfaceType {
@@ -563,7 +563,7 @@ class BadInterfaceType extends InterfaceType {
/**
* Special subclass of [TypedefType] used for generic typedef types created
* with the wrong number of type arguments.
- *
+ *
* The type uses [:dynamic:] for all it s type arguments.
*/
class BadTypedefType extends TypedefType {
@@ -851,7 +851,7 @@ class Member {
if (element.isAbstractField()) {
AbstractFieldElement abstractFieldElement = element;
// Use setter if present and required or if no getter is available.
- if ((isSetter && abstractFieldElement.setter != null) ||
+ if ((isSetter && abstractFieldElement.setter != null) ||
abstractFieldElement.getter == null) {
// TODO(johnniwinther): Add check of read of field with no getter.
FunctionType functionType =
@@ -934,8 +934,8 @@ class SubtypeVisitor extends DartTypeVisitor<bool, DartType> {
bool isSubtype(DartType t, DartType s) {
if (identical(t, s) ||
- t.treatAsDynamic ||
- s.treatAsDynamic ||
+ t.treatAsDynamic ||
+ s.treatAsDynamic ||
identical(s.element, compiler.objectClass) ||
identical(t.element, compiler.nullClass)) {
return true;
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698