aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/parser/qqmljsast_p.h
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2020-05-13 15:31:51 +0200
committerMaximilian Goldstein <max.goldstein@qt.io>2020-05-20 13:46:36 +0200
commit1c0c8509da2a27858f7b25ffa71d1b19690c708c (patch)
treef574288f0275755a5691697267e58044322753bf /src/qml/parser/qqmljsast_p.h
parentdcc65ddf83fc4ccf1127dfc002c7951d6288e0d5 (diff)
Fix 'as' binary operation using invalid types
Fixes: QTBUG-81392 Change-Id: Ic83091c547a7854b7fa86b44d93c575bd7426bae Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/parser/qqmljsast_p.h')
-rw-r--r--src/qml/parser/qqmljsast_p.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/qml/parser/qqmljsast_p.h b/src/qml/parser/qqmljsast_p.h
index 8c1d8a2510..700643e1df 100644
--- a/src/qml/parser/qqmljsast_p.h
+++ b/src/qml/parser/qqmljsast_p.h
@@ -217,6 +217,7 @@ public:
Kind_SwitchStatement,
Kind_TemplateLiteral,
Kind_TaggedTemplate,
+ Kind_TypeExpression,
Kind_ThisExpression,
Kind_ThrowStatement,
Kind_TildeExpression,
@@ -504,6 +505,26 @@ public:
SourceLocation rparenToken;
};
+
+class QML_PARSER_EXPORT TypeExpression : public ExpressionNode
+{
+public:
+ QQMLJS_DECLARE_AST_NODE(TypeExpression)
+ TypeExpression(Type *t) : m_type(t) { kind = K; }
+
+ void accept0(BaseVisitor *visitor) override;
+
+ SourceLocation firstSourceLocation() const override {
+ return m_type->firstSourceLocation();
+ }
+
+ SourceLocation lastSourceLocation() const override {
+ return m_type->lastSourceLocation();
+ }
+
+ Type *m_type;
+};
+
class QML_PARSER_EXPORT ThisExpression: public LeftHandSideExpression
{
public: