diff options
Diffstat (limited to 'tests/auto/qml/qqmlparser/data/disallowedtypeannotations')
10 files changed, 44 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/anonfunctionexpr.js b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/anonfunctionexpr.js new file mode 100644 index 0000000000..f660edb69e --- /dev/null +++ b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/anonfunctionexpr.js @@ -0,0 +1,3 @@ +(function () : string { + return "ko" +}) diff --git a/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/classmemberparam.js b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/classmemberparam.js new file mode 100644 index 0000000000..ab85d90880 --- /dev/null +++ b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/classmemberparam.js @@ -0,0 +1,6 @@ + +class Foo { + member(param: string) { + return "ko" + } +} diff --git a/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/classreturnvalue.js b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/classreturnvalue.js new file mode 100644 index 0000000000..a7da9e0ca7 --- /dev/null +++ b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/classreturnvalue.js @@ -0,0 +1,6 @@ + +class Foo { + member(): string { + return "ko" + } +} diff --git a/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/function.js b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/function.js new file mode 100644 index 0000000000..4d6021e835 --- /dev/null +++ b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/function.js @@ -0,0 +1,4 @@ + +function x() : string { + return "ok" +} diff --git a/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/functionexpr.js b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/functionexpr.js new file mode 100644 index 0000000000..33f2abbb61 --- /dev/null +++ b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/functionexpr.js @@ -0,0 +1,3 @@ +(function x() : string { + return "ko" +}) diff --git a/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/functionparams.js b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/functionparams.js new file mode 100644 index 0000000000..2c23628e3f --- /dev/null +++ b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/functionparams.js @@ -0,0 +1,3 @@ + +function test(x: string, y: string) { +} diff --git a/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/iteration.js b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/iteration.js new file mode 100644 index 0000000000..a6cc00e38a --- /dev/null +++ b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/iteration.js @@ -0,0 +1,3 @@ + +for (var i: int = 0; i < 100; ++i) { +} diff --git a/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/iteration2.js b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/iteration2.js new file mode 100644 index 0000000000..24d5acce98 --- /dev/null +++ b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/iteration2.js @@ -0,0 +1,5 @@ + +let y = [1, 2, 3]; + +for (let x: int of y) { +} diff --git a/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/qmlnestedfunction.qml b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/qmlnestedfunction.qml new file mode 100644 index 0000000000..f435bf1b25 --- /dev/null +++ b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/qmlnestedfunction.qml @@ -0,0 +1,9 @@ +import QtQuick 2.12 as MyQuick +MyQuick.Item { + function factory(param: string) : MyQuick.Item { + function nested(foo: string) { + return this + } + return nested() + } +} diff --git a/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/variables.js b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/variables.js new file mode 100644 index 0000000000..bf332ac7a8 --- /dev/null +++ b/tests/auto/qml/qqmlparser/data/disallowedtypeannotations/variables.js @@ -0,0 +1,2 @@ + +var x: string = "ko" |