Skip to content

Commit

Permalink
#2283: Added return type validating
Browse files Browse the repository at this point in the history
  • Loading branch information
levBagryansky committed Jul 24, 2023
1 parent 869893a commit 89612a4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions eo-runtime/src/main/java/EOorg/EOeolang/EOrust.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ public EOrust(final Phi sigma) {
name
)
).getDeclaredMethod(name, EOrust.class);
if (method.getReturnType() != byte[].class) {
throw new ExFailure(
"Return type of %s is %s, required %s",
method,
method.getReturnType(),
byte[].class
);
}
return EOrust.translate(
(byte[]) method.invoke(null, this)
);
Expand Down

0 comments on commit 89612a4

Please sign in to comment.