Skip to content

Commit 130de2d

Browse files
committed
allow single Object fields to accept any type in acceptChange
1 parent 8c5a1e3 commit 130de2d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/main/java/com/sovdee/oopsk/elements/expressions/ExprFieldAccess.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ protected Object[] get(Event event, Struct[] source) {
177177
// return all return types
178178
return Arrays.stream(returnTypes).map(Class::arrayType).toArray(Class<?>[]::new);
179179

180+
// if a field is single and object, it should allow object stuff
181+
if (isAnyFieldSingle && returnType == Object.class) {
182+
return new Class<?>[]{Object.class};
183+
}
184+
180185
// if the mode is set, always allow changes
181186
if (mode == ChangeMode.SET)
182187
// return all return types

0 commit comments

Comments
 (0)