[jboss-jira] [JBoss JIRA] Created: (JBRULES-2968) mistake in determining the type of an eval expression

Wolfgang Laun (JIRA) jira-events at lists.jboss.org
Wed Apr 20 05:42:33 EDT 2011


mistake in determining the type of an eval expression  
-------------------------------------------------------

                 Key: JBRULES-2968
                 URL: https://issues.jboss.org/browse/JBRULES-2968
             Project: Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: drools-compiler (expert)
    Affects Versions: 3.0.1
            Reporter: Wolfgang Laun
            Assignee: Mark Proctor
            Priority: Blocker


This rule compiled correctly a few weeks ago where MyDate contains the int field "year":

rule "Day in leap year"
when
    $d: MyDate( $y: year, eval( $y % 4 == 0 && $y % 100 != 0 || $y % 400 == 0 ) )
then
    System.out.println( $d.toString() + " is in a leap year" );
end

But now errors are reported:

Unable to build expression for 'inline-eval' : [Error: was expecting type: java.lang.Boolean; but found type: java.lang.Integer]
[Near : {... $y % 4 == 0 && $y % 100 != 0 || $y % 400 == 0 ....}]
                                                          ^
[Line: 1, Column: 46]' $y % 4 == 0 && $y % 100 != 0 || $y % 400 == 0 '
[Error: was expecting type: java.lang.Boolean; but found type: java.lang.Integer]
[Near : {... $y % 4 == 0 && $y % 100 != 0 || $y % 400 == 0 ....}]
                                                          ^
[Line: 1, Column: 46] : [Rule name='Day in leap year']
[Error: was expecting type: java.lang.Boolean; but found type: java.lang.Integer]
[Near : {... $y % 4 == 0 && $y % 100


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list