[QBS] ReferenceError: Can't find variable: type

Denis Shienkov denis.shienkov at gmail.com
Wed Jul 29 10:38:24 CEST 2015


> so the example you posted is not valid code and the error
message is correct.

1) Why then this does not work even when I add the "product.type" instead
of "type" inside the module?

Module {
     property stringList example: product.type.contains("bla") ? ["123"] :
["456"]
}


2) But this works fine and with the "type" and with the "product.type" in
case is used the "string" property instead of "stringList" property:

Module {
     property string example: product.type.contains("bla") ? "123" : "456"
}

Module {
     property string example: type.contains("bla") ? "123" : "456"
}

3) Is there any workaround for this issue?

BTW,
This bug is in "reported" state about a month..
Or do you think that it not a hard error and it shouldn't be fixed at all?


BR,
Denis



2015-07-29 11:00 GMT+03:00 Christian Kandeler <
christian.kandeler at theqtcompany.com>:

> On 07/29/2015 09:43 AM, Denis Shienkov wrote:
> > Hi folks,
> >
> > is there are any progress with this?
>
> Please don't cross-post. There is also no need to duplicate JIRA issues
> on the mailing list.
> As I have pointed out before, there is no such thing as "type" in that
> context, so the example you posted is not valid code and the error
> message is correct.
>
>
> Christian
>
> >
> > BR,
> > Denis
> >
> > 2015-07-15 11:32 GMT+03:00 Denis Shienkov <denis.shienkov at gmail.com
> > <mailto:denis.shienkov at gmail.com>>:
> >
> >     Hi all.
> >
> >     Can someone look on this bug:
> https://bugreports.qt.io/browse/QBS-832 ?
> >
> >     There is an epic bug which can be reproduced so:
> >
> >
> >     =
> >
>  c:\Qt\Qt5.5.0-msvc\Tools\QtCreator\share\qtcreator\qbs\share\qbs\modules\foo\FooModule.qbs
> >     =
> >
> >     import  qbs
> >     import  qbs.ModUtils
> >
> >     Module {
> >          property stringList example: type.contains("bla") ? ["123"] :
> ["456"]
> >     }
> >
> >     === test.qbs ==
> >
> >     import  qbs
> >
> >     Project {
> >          Product {
> >              name:"Bar"
> >              Depends {name:"foo"  }
> >              foo.example: ["789"]// <<< this fails      }
> >     }
> >
> >
> >     In this case unable to open the QBS project at all, because can not
> >     parse:
> >
> >     "ReferenceError: Can't find variable: type"
> >
> >     This does not work on Windows 8x32, QtCreator 3.4.2.. But works with
> >     QtCreator 3.4.1.
> >
> >     What is it? :((
> >
> >     BR,
> >     Denis
> >
> >     //
> >
> >
>
> _______________________________________________
> QBS mailing list
> QBS at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qbs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20150729/9d184a0c/attachment.html>


More information about the Qbs mailing list