summaryrefslogtreecommitdiff
path: root/src/qml/compiler/qv4compilerscanfunctions.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-01-22 16:03:28 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2019-07-09 16:52:31 +0200
commit2377a02afe8d8b4237b703e88ef3423242ec7cf8 (patch)
tree3a091f50f80612ae3c25fcacc2edef6df0bbf34a /src/qml/compiler/qv4compilerscanfunctions.cpp
parent1b866db65eb45ff347b51a2bc3b08d2a0bc166d6 (diff)
downloadqtdeclarative-2377a02afe8d8b4237b703e88ef3423242ec7cf8.tar.gz
Collect type information for function parameters
Change-Id: Ia9ba819ce77eee7e582cf90aacf5baa4813d9fca Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compilerscanfunctions.cpp')
-rw-r--r--src/qml/compiler/qv4compilerscanfunctions.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4compilerscanfunctions.cpp b/src/qml/compiler/qv4compilerscanfunctions.cpp
index da22a2d826..9eaf0adf70 100644
--- a/src/qml/compiler/qv4compilerscanfunctions.cpp
+++ b/src/qml/compiler/qv4compilerscanfunctions.cpp
@@ -696,10 +696,14 @@ bool ScanFunctions::enterFunction(Node *ast, const QString &name, FormalParamete
bool isSimpleParameterList = formals && formals->isSimpleParameterList();
- _context->arguments = formals ? formals->formals() : QStringList();
+ _context->arguments = formals ? formals->formals() : BoundNames();
const BoundNames boundNames = formals ? formals->boundNames() : BoundNames();
for (int i = 0; i < boundNames.size(); ++i) {
+ if (auto type = boundNames.at(i).typeAnnotation) {
+ _cg->throwSyntaxError(type->firstSourceLocation(), QLatin1String("Type annotations are not supported (yet)."));
+ return false;
+ }
const QString &arg = boundNames.at(i).id;
if (_context->isStrict || !isSimpleParameterList) {
bool duplicate = (boundNames.indexOf(arg, i + 1) != -1);