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

Type checker fails to upcast argument types when matching new expression to candidate constructor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 3.0.4
    • 3.0.3
    • Parser/Type Checker
    • None
    • Hide

      A workaround is to declare a rule (BIND) variable with the expected parameter type, assign it to the actual argument and then pass the variable as argument to the constructor (see the related forum thread for an example).

      Show
      A workaround is to declare a rule (BIND) variable with the expected parameter type, assign it to the actual argument and then pass the variable as argument to the constructor (see the related forum thread for an example).

    Description

      When type checking a method (or new) expression Byteman has to filter candidate methods (or, respectively, constructors) to pick the target for the call, by reconciling the type signature of each candidate with the type information available for the actual method arguments. It is supposed to pick the method lowest down the tree whose signature types are compatible with the argument types. Compatible here means that the actual type equals the parameter type modulo conversion of the actual type either by upcasting or by one of the automatic type conversions Byteman is willing to perform (i.e. boxing, unboxing, toString conversion or numeric interconversion). This check appears to be failing in the case of a new expression (at least) as exemplified in the related forum post where an upcast from actual argument type FileOutputStream to expected parameter type OutputStream is not being performed.

      Attachments

        Activity

          People

            rhn-engineering-adinn Andrew Dinn
            jwhiting@redhat.com Jeremy Whiting
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: