Skip to content

Commit ab41791

Browse files
committed
fix(StaticMetadataExtractor): Map members annotations to all annotations
Closes dart-archive#904
1 parent 90f7582 commit ab41791

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/tools/transformer/metadata_extractor.dart

+6-3
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,11 @@ class AnnotationExtractor {
284284
annotation.parent.element);
285285
return false;
286286
}
287-
return element.enclosingElement.type.isAssignableTo(directiveType.type) ||
288-
element.enclosingElement.type.isAssignableTo(formatterType.type);
287+
288+
enclosingType = element.enclosingElement.type;
289+
290+
return enclosingType.isAssignableTo(directiveType.type) ||
291+
enclosingType.isAssignableTo(formatterType.type);
289292
}).toList();
290293

291294
if (type.annotations.isEmpty) return null;
@@ -359,7 +362,7 @@ class AnnotationExtractor {
359362
var map = new MapLiteral(null, null, null, [], null);
360363
var label = new Label(new SimpleIdentifier(
361364
new _GeneratedToken(TokenType.STRING, 'map')),
362-
new _GeneratedToken(TokenType.COLON, ':'));
365+
new _GeneratedToken(TokenType.COLON, ':'));
363366
mapArg = new NamedExpression(label, map);
364367
annotation.arguments.arguments.add(mapArg);
365368
}

0 commit comments

Comments
 (0)