Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-124498

qmltyperesolver can't handle ECMAScript resources

    XMLWordPrintable

Details

    • 001cb7bfb (dev), 943633724 (6.8), c6502fcf8 (6.7), 0bc6a72b7 (tqtc/lts-6.5)

    Description

      ECMAScript resources end up as ScopeModulePrefix with their stored type being void.
      This for instance manifests in qmllint creating errorneous warnings in the calqlatr example, like

      Member "operatorPressed" not found on type "undefined" [missing-property]
      

      for calls. Non-calling lookups (as in, just accessing the function without calling) fare only slightly better (using a modified calqlatr example):

      Warning: /home/fabian/projects/qtdev/qtdoc/examples/demos/calqlatr/Main.qml:21:24: Type not found in namespace [unresolved-type]
                  CalcEngine.operatorPressed
                             ^^^^^^^^^^^^^^^
      Warning: /home/fabian/projects/qtdev/qtdoc/examples/demos/calqlatr/Main.qml:21:24: Member "operatorPressed" not found on type "undefined" [missing-property]
                  CalcEngine.operatorPressed
      

      At the very least, they should be treated as `var` by qmllint; ideally, we'd actually collect the known functions and global variables.


      Yes, one could convert the example to use a Singleton; that doesn't change the fact that we shouldn't create spurious warnings.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-124498
          # Subject Branch Project Status CR V

          Activity

            People

              olivier.decanniere Olivier De Cannière
              fabiankosmale Fabian Kosmale
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews