Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-83

Cannot use imported classes in declared types fields initialization

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 5.5.1.Final, 6.0.0.Alpha9
    • None
    • None
    • None

      Having added the following import statements in the drl:

      import org.drools.compiler.test.Person
      import org.drools.compiler.test.Man

      this field initialization in a declared type in the same drl doesn't compile:

      persons: Person[] = new Person[]

      { new Man() }

      As a workaround, note that adding the full class names fixes the problem:

      persons: Person[] = new org.drools.compiler.test.Person[]

      { new org.drools.compiler.test.Man() }

            mfusco@redhat.com Mario Fusco
            mfusco@redhat.com Mario Fusco
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: