Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

fix(StaticMetadataExtractor): Map members annotations to all annotations #926

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lib/tools/transformer/metadata_extractor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,11 @@ class AnnotationExtractor {
annotation.parent.element);
return false;
}
return element.enclosingElement.type.isAssignableTo(directiveType.type) ||
element.enclosingElement.type.isAssignableTo(formatterType.type);

enclosingType = element.enclosingElement.type;

return enclosingType.isAssignableTo(directiveType.type) ||
enclosingType.isAssignableTo(formatterType.type);
}).toList();

if (type.annotations.isEmpty) return null;
Expand Down Expand Up @@ -359,7 +362,7 @@ class AnnotationExtractor {
var map = new MapLiteral(null, null, null, [], null);
var label = new Label(new SimpleIdentifier(
new _GeneratedToken(TokenType.STRING, 'map')),
new _GeneratedToken(TokenType.COLON, ':'));
new _GeneratedToken(TokenType.COLON, ':'));
mapArg = new NamedExpression(label, map);
annotation.arguments.arguments.add(mapArg);
}
Expand Down