aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4codegen_p.h
diff options
context:
space:
mode:
authorOlivier De Cannière <olivier.decanniere@qt.io>2024-04-19 10:34:05 +0200
committerOlivier De Cannière <olivier.decanniere@qt.io>2024-04-22 15:50:28 +0200
commit04eca69846a531ec26c8bb9be20dddd75fb111fe (patch)
tree9a870bda4485618b32b86621679d363471a36cc7 /src/qml/compiler/qv4codegen_p.h
parent152e6716baeffd22c381df8c37c188b8eab7d9df (diff)
qv4codegen: Store the location of binary expressions
This location is then used later, for example, to improve the accuracy of warnings. OLD Warning: Main.qml:22:30: function without return type annotation returns double of double [compiler] function type() { return 1 + 1 } ^^^^^^ NEW Warning: Main.qml:22:30: function without return type annotation returns double of double [compiler] function type() { return 1 + 1 } ^^^^^ The location stored is the combined locations of the left operand, the operator, and the right operator. We should investigate if this is the right approach. Created QTBUG-124548. Task-number: QTBUG-124548 Task-number: QTBUG-124220 Pick-to: 6.7 Change-Id: Icac335d53349c05d0e9ee6e436bc6ab08ad970d2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4codegen_p.h')
-rw-r--r--src/qml/compiler/qv4codegen_p.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4codegen_p.h b/src/qml/compiler/qv4codegen_p.h
index d9a04dcd92..3a27cb1487 100644
--- a/src/qml/compiler/qv4codegen_p.h
+++ b/src/qml/compiler/qv4codegen_p.h
@@ -711,7 +711,8 @@ public:
QQmlJS::DiagnosticMessage error() const;
QUrl url() const;
- Reference binopHelper(QSOperator::Op oper, Reference &left, Reference &right);
+ Reference binopHelper(QQmlJS::AST::BinaryExpression *ast, QSOperator::Op oper, Reference &left,
+ Reference &right);
Reference jumpBinop(QSOperator::Op oper, Reference &left, Reference &right);
struct Arguments { int argc; int argv; bool hasSpread; };
Arguments pushArgs(QQmlJS::AST::ArgumentList *args);