Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-614

Name resolution/scope is weird.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 1.2.1
    • None

      Hi, I've not tested this extensively but it seems like the name/id scoping is very weird. Example:

      Product {
          // ...
          property string myProperty: path + "/foo.txt"
      }
      

      As expected, myProperty is set to c:/Users/me/MyProject/foo.txt (or whatever). However if you do this:

      Product {
          // ...
          property string myProperty: path + "/foo.txt"
          Probe {
               id: searcher
               property string path
               configure: {
                     path = "bar";
                     found = true;
               }
          }
      }
      

      It comes out as "bar/foo.txt". I guess maybe that makes sense... but I would have thought I'd have to do `product.path = ...` in the configure script to get that behaviour.

      Maybe there should at least be a warning if you name any of your properties the same as a magic variable.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            jbornema Joerg Bornemann
            timmmm Tim
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes