Skip to content

Commit

Permalink
Fixed review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
tzezula committed Jul 28, 2022
1 parent c6d2e1a commit c8b5e5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions truffle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ This changelog summarizes major changes between Truffle versions relevant to lan
* GR-34894 Introduced `Location.isPrimitive()`, `Location.getConstantValue()`, and `Shape.makePropertyGetter(Object)`.
* GR-39058 The Static Object Model offers preliminary support for field-based storage also on Native Image.
* GR-24927 A compilation error is emitted for methods annotated by a `@TruffleBoundary` annotation and taking a `Frame` parameter.
* GR-24927 The Truffle annotation processor now emits an error for methods annotated by a `@TruffleBoundary` annotation and a `Frame` parameter. Previously, the processor only reported an error for `VirtualFrame` parameters. To resolve this, either change the parameter to a `MaterializedFrame` , remove the parameter or remove the `@TruffleBoundary`.

## Version 22.1.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,11 @@ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment
for (VariableElement parameter : method.getParameters()) {
Element paramType = processingEnv.getTypeUtils().asElement(parameter.asType());
if (paramType != null && (paramType.equals(virtualFrameType) || paramType.equals(frameType))) {
errorMessage(element, "Method %s cannot be annotated with @%s and have a parameter of type %s", method.getSimpleName(),
types.CompilerDirectives_TruffleBoundary.asElement().getSimpleName().toString(),
paramType.getSimpleName());
CharSequence truffleBoundarySimpleName = types.CompilerDirectives_TruffleBoundary.asElement().getSimpleName();
errorMessage(element, "Method %s cannot be annotated with @%s and have a parameter of type %s.%n" +
"To resolve this, either change the parameter to a %s, remove the parameter or remove the @%s.", method.getSimpleName(),
truffleBoundarySimpleName, paramType.getSimpleName(), types.MaterializedFrame.asElement().getSimpleName(),
truffleBoundarySimpleName);
}
}
} catch (Throwable t) {
Expand Down

0 comments on commit c8b5e5a

Please sign in to comment.