Uploaded image for project: 'Byteman'
  1. Byteman
  2. BYTEMAN-315

Bindings type may check incorrectly when the declared type omits package qualifier

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.0.5
    • 3.0.3
    • Parser/Type Checker
    • None

      BIND variable delcarations which employ an initializer and a type name without a package qualifier may end up using the wrong type for the BIND var e.g. given classes org.my.Foo and org.my.FooBar

      BIND foo : Foo = $0.returnMeFooBar()

      may use the return type org.my.FooBar of method returnMeFooBar() as the type for foo even when it bears no relation to Foo.

      This only happens when Foo is unknown at the point the binding is type checked i.e. when none of the other preceding elements of the rule provide type information which allows the bare name Foo to be associated with the package qualified name org.my.Foo and hence resolved to a class of that name.

      The fix should allow the resolved class for Foo to be inferred form the type of the initializer in such cases. For example, if the return type of returnMeFooBar() is x.y.Foo or is a class class org.my.FooBar which is a subclass of a class called x.y.Foo or an implementation of an interface claled x.y.Foo then the appropriately named class should be used to resolve the declaration type Foo.

              rhn-engineering-adinn Andrew Dinn
              rhn-engineering-adinn Andrew Dinn
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: