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

Side by Side Diff: runtime/lib/mirrors_impl.dart

Issue 2793033005: Keep types in signatures of function types properly instantiated as the function (Closed)
Patch Set: added comment and sync Created 3 years, 8 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
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // VM-specific implementation of the dart:mirrors library. 5 // VM-specific implementation of the dart:mirrors library.
6 6
7 import "dart:collection" show UnmodifiableListView, UnmodifiableMapView; 7 import "dart:collection" show UnmodifiableListView, UnmodifiableMapView;
8 import "dart:_internal" as internal; 8 import "dart:_internal" as internal;
9 9
10 var _dirty = false; 10 var _dirty = false;
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 MethodMirror get callMethod { 943 MethodMirror get callMethod {
944 if (_callMethod == null) { 944 if (_callMethod == null) {
945 _callMethod = _FunctionTypeMirror_call_method(_functionReflectee); 945 _callMethod = _FunctionTypeMirror_call_method(_functionReflectee);
946 } 946 }
947 return _callMethod; 947 return _callMethod;
948 } 948 }
949 949
950 TypeMirror _returnType = null; 950 TypeMirror _returnType = null;
951 TypeMirror get returnType { 951 TypeMirror get returnType {
952 if (_returnType == null) { 952 if (_returnType == null) {
953 _returnType = reflectType( 953 _returnType =
954 _FunctionTypeMirror_return_type(_functionReflectee, _instantiator)); 954 reflectType(_FunctionTypeMirror_return_type(_functionReflectee));
955 } 955 }
956 return _returnType; 956 return _returnType;
957 } 957 }
958 958
959 List<ParameterMirror> _parameters = null; 959 List<ParameterMirror> _parameters = null;
960 List<ParameterMirror> get parameters { 960 List<ParameterMirror> get parameters {
961 if (_parameters == null) { 961 if (_parameters == null) {
962 _parameters = _FunctionTypeMirror_parameters(_functionReflectee); 962 _parameters = _FunctionTypeMirror_parameters(_functionReflectee);
963 _parameters = new UnmodifiableListView(_parameters); 963 _parameters = new UnmodifiableListView(_parameters);
964 } 964 }
965 return _parameters; 965 return _parameters;
966 } 966 }
967 967
968 bool get isOriginalDeclaration => true; 968 bool get isOriginalDeclaration => true;
969 get originalDeclaration => this; 969 get originalDeclaration => this;
970 get typeVariables => _emptyList; 970 get typeVariables => _emptyList;
971 get typeArguments => _emptyList; 971 get typeArguments => _emptyList;
972 get metadata => _emptyList; 972 get metadata => _emptyList;
973 get location => null; 973 get location => null;
974 974
975 String toString() => "FunctionTypeMirror on '${_n(simpleName)}'"; 975 String toString() => "FunctionTypeMirror on '${_n(simpleName)}'";
976 976
977 MethodMirror _FunctionTypeMirror_call_method(functionReflectee) 977 MethodMirror _FunctionTypeMirror_call_method(functionReflectee)
978 native "FunctionTypeMirror_call_method"; 978 native "FunctionTypeMirror_call_method";
979 979
980 static Type _FunctionTypeMirror_return_type(functionReflectee, instantiator) 980 static Type _FunctionTypeMirror_return_type(functionReflectee)
981 native "FunctionTypeMirror_return_type"; 981 native "FunctionTypeMirror_return_type";
982 982
983 List<ParameterMirror> _FunctionTypeMirror_parameters(functionReflectee) 983 List<ParameterMirror> _FunctionTypeMirror_parameters(functionReflectee)
984 native "FunctionTypeMirror_parameters"; 984 native "FunctionTypeMirror_parameters";
985 } 985 }
986 986
987 abstract class _LocalDeclarationMirror extends _LocalMirror 987 abstract class _LocalDeclarationMirror extends _LocalMirror
988 implements DeclarationMirror { 988 implements DeclarationMirror {
989 final _reflectee; 989 final _reflectee;
990 Symbol _simpleName; 990 Symbol _simpleName;
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
1647 } 1647 }
1648 1648
1649 static Type _instantiateType(Type key, List<Type> typeArguments) { 1649 static Type _instantiateType(Type key, List<Type> typeArguments) {
1650 if (typeArguments.isEmpty) { 1650 if (typeArguments.isEmpty) {
1651 throw new ArgumentError.value(typeArguments, 'typeArguments', 1651 throw new ArgumentError.value(typeArguments, 'typeArguments',
1652 'Type arguments list cannot be empty.'); 1652 'Type arguments list cannot be empty.');
1653 } 1653 }
1654 return instantiateGenericType(key, typeArguments.toList(growable: false)); 1654 return instantiateGenericType(key, typeArguments.toList(growable: false));
1655 } 1655 }
1656 } 1656 }
OLDNEW
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698