Files
qt-creator/tests/auto/qml/codemodel/check/unreachable.qml
Fawzi Mohamed cc00af8334 qmljs: fix qmljscheck
* fix ASTVariableReference::value: correctly get reference value type
by using either initialiser of bindingTarget (broken since a codemodel
update in 2018)
* disable warning for casting in bool to null comparison (it does not
cast, is always false)
* fix property checks (where skipped without default of readonly)
* remove non relevant checks (ErrInvalidPropertyType for lowercase  now that custom
value types are supported, and for properties called data)
* updated import version

Change-Id: I38407acf327d0f773b38dda4c02fb4d95a420851
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 14:03:44 +00:00

105 lines
1.6 KiB
QML

import QtQuick 2.0
// DEFAULTMSG unreachable
Item {
function foo() {
return
x() // 28 9 11
x()
}
function foo() {
throw {}
x() // 28 9 11
x()
}
function foo() {
if (a)
return
x()
if (a)
foo();
else
return
x()
if (a)
return
else
return
x() // 28 9 11
}
function foo() {
try {
throw 1
} finally {}
x() // 28 9 11
}
function foo() {
try {
} finally {
return
}
x() // 28 9 11
}
function foo() {
try {
} catch(a) {
return
}
x()
try {
return
} catch(a) {
}
x()
try {
return
} catch(a) {
return
}
x() // 28 9 11
}
function foo() {
switch (a) {
case 0:
break
case 1:
case 2:
return
}
x()
switch (a) {
case 1:
case 2:
return
}
x()
switch (a) {
case 1:
case 2:
return
default:
return
}
x() // 28 9 11
}
function foo() {
l1: do {
l2: while (b) {
return
}
x()
l3: do {
break l1
} while (b);
x() // 28 13 15
} while (a);
x() // reachable via break
}
}