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

PluisExpression typecheck method does not assign its type when it's operand types are strings

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 1.5.2
    • 1.5.1
    • Parser/Type Checker
    • None
    • Hide

      Execute a rule like

      ...
      BIND x : "x";
      y : "y"
      IF TRUE
      DO traceln(x + " + " + y)
      ...

      The intermediate expression for x + " + " will be typed as undefined.

      Show
      Execute a rule like ... BIND x : "x"; y : "y" IF TRUE DO traceln(x + " + " + y) ... The intermediate expression for x + " + " will be typed as undefined.

    Description

      When the first expression of a plus operation is not a String literal a PlusExpression is created during parsing instead of StringPlusExpression. During type checking if the first operand turns out to have type String rather than a numeric type then the second argument is type checked against String and the result type is determined to be a String. However, the type check method fails to assign the type leaving it as TYPE.Undefined. If this expression is consumed by another expression it causes a type check failure.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: