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

Bogus type annotation causes runtime dependency cycle

    XMLWordPrintable

Details

    Description

      import QtQml
      
      QtObject {
          function f(a: Main.Whatever) : int { return 1 }
          Component.onCompleted: console.log(f(1))
      } 

      The type annotation does not make sense. (I stumbled upon this while working on https://bugreports.qt.io/browse/QTBUG-135255) However, this code generates a dependency cycle warning at runtime and does not execute f.

      qt.qml.typeresolution.cycle: Cyclic dependency detected between "qrc:/qt/qml/Truc/Main.qml" and "qrc:/qt/qml/Truc/Main.qml" 

      Removing the type annotation or replacing it with int fixes the issue.

      This does not reproduce in 6.8 or later.

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            olivier.decanniere Olivier De Cannière
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes