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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart

Issue 12210013: Implement subtype for type variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 mirrors_dart2js; 5 library mirrors_dart2js;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection' show LinkedHashMap; 8 import 'dart:collection' show LinkedHashMap;
9 import 'dart:io'; 9 import 'dart:io';
10 import 'dart:uri'; 10 import 'dart:uri';
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1152 } 1152 }
1153 1153
1154 LibraryMirror get library => declarer.library; 1154 LibraryMirror get library => declarer.library;
1155 1155
1156 DeclarationMirror get owner => declarer; 1156 DeclarationMirror get owner => declarer;
1157 1157
1158 bool get isTypeVariable => true; 1158 bool get isTypeVariable => true;
1159 1159
1160 TypeMirror get upperBound => _convertTypeToTypeMirror( 1160 TypeMirror get upperBound => _convertTypeToTypeMirror(
1161 mirrors, 1161 mirrors,
1162 _typeVariableType.element.bound, 1162 _typeVariableType.element.upperBound,
1163 mirrors.compiler.objectClass.computeType(mirrors.compiler)); 1163 mirrors.compiler.objectClass.computeType(mirrors.compiler));
1164 1164
1165 bool operator ==(Object other) { 1165 bool operator ==(Object other) {
1166 if (identical(this, other)) { 1166 if (identical(this, other)) {
1167 return true; 1167 return true;
1168 } 1168 }
1169 if (other is! TypeVariableMirror) { 1169 if (other is! TypeVariableMirror) {
1170 return false; 1170 return false;
1171 } 1171 }
1172 if (declarer != other.declarer) { 1172 if (declarer != other.declarer) {
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
1857 return new Future.immediate( 1857 return new Future.immediate(
1858 new Dart2JsStringConstantMirror.fromString(mirrors, text)); 1858 new Dart2JsStringConstantMirror.fromString(mirrors, text));
1859 } else if (fieldName == 'trimmedText') { 1859 } else if (fieldName == 'trimmedText') {
1860 return new Future.immediate( 1860 return new Future.immediate(
1861 new Dart2JsStringConstantMirror.fromString(mirrors, trimmedText)); 1861 new Dart2JsStringConstantMirror.fromString(mirrors, trimmedText));
1862 } 1862 }
1863 // TODO(johnniwinther): Which exception/error should be thrown here? 1863 // TODO(johnniwinther): Which exception/error should be thrown here?
1864 throw new UnsupportedError('InstanceMirror does not have a reflectee'); 1864 throw new UnsupportedError('InstanceMirror does not have a reflectee');
1865 } 1865 }
1866 } 1866 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698