@@ -43,7 +43,8 @@ dynamic instantiateAnnotation(ElementAnnotation annotation) {
4343 return _createFromConstructor (element, annotationObject);
4444 }
4545
46- var valueDeclaration = _getDeclMirrorFromType (annotation.constantValue.type);
46+ var valueDeclaration =
47+ _getDeclarationMirrorFromType (annotation.constantValue.type);
4748
4849 throw "No clue how to create $valueDeclaration of type ${valueDeclaration .runtimeType }" ;
4950}
@@ -77,7 +78,8 @@ dynamic _getValue(DartObject object, TypeProvider typeProvider) {
7778 var typeData = object.toTypeValue ();
7879
7980 if (typeData is InterfaceType ) {
80- var declarationMirror = _getDeclMirrorFromType (typeData) as ClassMirror ;
81+ var declarationMirror =
82+ _getDeclarationMirrorFromType (typeData) as ClassMirror ;
8183
8284 return declarationMirror.reflectedType;
8385 }
@@ -134,11 +136,11 @@ final _cannotCreate = new Object();
134136
135137dynamic _createFromConstructor (
136138 ConstructorElementImpl ctor, DartObjectImpl obj) {
137- var ctorDecl = ctor.computeNode ();
139+ var ctorDeclaration = ctor.computeNode ();
138140
139141 var positionalArgs = [];
140142 var namedArgs = < Symbol , dynamic > {};
141- for (var p in ctorDecl .parameters.parameterElements) {
143+ for (var p in ctorDeclaration .parameters.parameterElements) {
142144 var paramName = p.name;
143145 String fieldName;
144146 if (p is FieldFormalParameterElement ) {
@@ -177,22 +179,22 @@ dynamic _createFromConstructor(
177179 }
178180
179181 Symbol ctorName;
180- if (ctorDecl .name == null ) {
182+ if (ctorDeclaration .name == null ) {
181183 ctorName = const Symbol ('' );
182184 } else {
183- ctorName = new Symbol (ctorDecl .name.name);
185+ ctorName = new Symbol (ctorDeclaration .name.name);
184186 }
185187
186- var declMirror =
187- _getDeclMirrorFromType (ctor.enclosingElement.type) as ClassMirror ;
188+ var declarationMirror =
189+ _getDeclarationMirrorFromType (ctor.enclosingElement.type) as ClassMirror ;
188190
189191 // figure out which ctor was used!
190192 var instanceMirror =
191- declMirror .newInstance (ctorName, positionalArgs, namedArgs);
193+ declarationMirror .newInstance (ctorName, positionalArgs, namedArgs);
192194 return instanceMirror.reflectee;
193195}
194196
195- DeclarationMirror _getDeclMirrorFromType (InterfaceType type) {
197+ DeclarationMirror _getDeclarationMirrorFromType (InterfaceType type) {
196198 var system = currentMirrorSystem ();
197199
198200 // find library
0 commit comments