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

qmltyperesolver can't handle ECMAScript resources

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • 6.8
    • 6.8
    • QML: Compiler, QML: Tooling
    • None

    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

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

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes