From 2377a02afe8d8b4237b703e88ef3423242ec7cf8 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 22 Jan 2019 16:03:28 +0100 Subject: Collect type information for function parameters Change-Id: Ia9ba819ce77eee7e582cf90aacf5baa4813d9fca Reviewed-by: Ulf Hermann Reviewed-by: Fabian Kosmale --- src/qml/compiler/qv4compilerscanfunctions.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/qml/compiler/qv4compilerscanfunctions.cpp') 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); -- cgit v1.2.1