]
Edson Tirelli resolved JBRULES-3193.
------------------------------------
Resolution: Done
Fixed.
Drools compiler was not taking into account the locally declared variable types when
trying to infer the result type of the modify expression.
Modify block does not work with variables declared in the
consequence
---------------------------------------------------------------------
Key: JBRULES-3193
URL:
https://issues.jboss.org/browse/JBRULES-3193
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-compiler
Affects Versions: 5.2.0.Final, 5.3.0.Beta1
Reporter: Edson Tirelli
Assignee: Edson Tirelli
Fix For: 5.3.0.CR1
Reported by Wolfgang:
========
This rule
{code:title=test.drl|borderStyle=solid}
rule "test"
when
$l : ArrayList() from collect (MyClass (attribute == false));
then
for(Object o : new ArrayList( $l )) {
MyClass o2 = (MyClass) o;
modify(o2) { setAttribute(true) }
}
end
{code}
does not compile: The method setAttribute(boolean) is undefined for the type Object
This, however, works:
{code}
modify( (MyClass)o) { setAttribute(true) }
{code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: