Skip to content

Commit

Permalink
Prepare for separation of ClassElement, EnumElement and MixinElement. (
Browse files Browse the repository at this point in the history
…#617)

* Prepare for separation of ClassElement, EnumElement and MixinElement.

* Throw explicitly.
  • Loading branch information
scheglov committed Aug 29, 2022
1 parent bd6f791 commit 0d4c54d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source_gen/lib/src/constants/revive.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Revivable reviveInstance(DartObject object, [LibraryElement? origin]) {
);
}

if (element is ClassElement) {
if (element is InterfaceElement) {
for (final e in element.fields.where(
(f) => f.isPublic && f.isConst && f.computeConstantValue() == object,
)) {
Expand Down
2 changes: 1 addition & 1 deletion source_gen/test/generator_for_annotation_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class _TestingResolver implements ReleasableResolver {
bool allowSyntaxErrors = false,
}) async {
resolvedLibs.add(assetId);
return null as LibraryElement;
throw StateError('This method intentionally throws');
}

@override
Expand Down

0 comments on commit 0d4c54d

Please sign in to comment.