diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2016-03-22 14:49:21 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@theqtcompany.com> | 2016-04-05 08:09:19 +0000 |
commit | 7c18dcf79abbcc4de085e73ca7abe4eeeb7f140c (patch) | |
tree | 2517c9863549e3248aab0034a2ff4db6ba086322 /src/qml/compiler/qv4ssa.cpp | |
parent | fcbbedc3c21ff69d9251264dd708d6ca66c09359 (diff) |
QML: add type info for the built-in qml context.
Previously, the type for the target temp would be 'var', which would
subsequently be corrected to qobject through a member access. That
resulted in typing the defining move again, which is unnecessary.
Change-Id: Ife993a667331e69aea64ac2af0f64096a142a583
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/compiler/qv4ssa.cpp')
-rw-r--r-- | src/qml/compiler/qv4ssa.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp index 6a4c1c54d6..f7cdd1b0b5 100644 --- a/src/qml/compiler/qv4ssa.cpp +++ b/src/qml/compiler/qv4ssa.cpp @@ -2435,13 +2435,22 @@ protected: virtual void visitExp(Exp *s) { _ty = run(s->expr); } virtual void visitMove(Move *s) { - TypingResult sourceTy = run(s->source); if (Temp *t = s->target->asTemp()) { + if (Name *n = s->source->asName()) { + if (n->builtin == Name::builtin_qml_context) { + _ty = TypingResult(t->memberResolver); + setType(n, _ty.type); + setType(t, _ty.type); + return; + } + } + TypingResult sourceTy = run(s->source); setType(t, sourceTy.type); _ty = sourceTy; return; } + TypingResult sourceTy = run(s->source); _ty = run(s->target); _ty.fullyTyped &= sourceTy.fullyTyped; } |