File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -214,15 +214,25 @@ DeclarationMirror _getDeclarationMirrorFromType(InterfaceType type) {
214214 return libMirror.declarations[typeNameSymbol];
215215}
216216
217+ /// Checks whether the constant type of [annotation] is equivalent to
218+ /// [annotationType] .
217219bool matchAnnotation (Type annotationType, ElementAnnotation annotation) {
218- var classMirror = reflectClass (annotationType);
219- var classMirrorSymbol = classMirror.simpleName;
220-
221220 var annotationValueType = annotation.constantValue? .type;
222221 if (annotationValueType == null ) {
223222 throw new ArgumentError .value (annotation, 'annotation' ,
224223 'Could not determine type of annotation. Are you missing a dependency?' );
225224 }
225+
226+ return matchTypes (annotationType, annotationValueType);
227+ }
228+
229+ /// Checks whether [annotationValueType] is equivalent to [annotationType] .
230+ ///
231+ /// Currently, this uses mirrors to compare the name and library uri of the two
232+ /// types.
233+ bool matchTypes (Type annotationType, ParameterizedType annotationValueType) {
234+ var classMirror = reflectClass (annotationType);
235+ var classMirrorSymbol = classMirror.simpleName;
226236
227237 var annTypeName = annotationValueType.name;
228238 var annotationTypeSymbol = new Symbol (annTypeName);
You can’t perform that action at this time.
0 commit comments