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

Drop optional when nullish coalescing an optional T with a rhs of type T

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P1: Critical P1: Critical
    • 6.10
    • 6.7
    • QML: Compiler
    • None
    • 2b336217b (dev)

      It should be possible to do this:

      property int i: (Anything as int) ?? 1 

      In both cases an int is returned and the optional can be dropped. 

       

      This does currently not work because of 

       (strict mode) Cannot assign potential undefined to int ... 

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

            qtqmlteam Qt Qml Team User
            olivier.decanniere Olivier De Cannière
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes