qore
qore copied to clipboard
Casts need to be implemented for basic built-in types
%new-style
string a = cast<string>("test");
output:
omusil@giger:~$ qore test.q
unhandled QORE System exception thrown in TID 1 at 2017-08-29 15:49:54.464712 Tue +02:00 (CEST) at test.q:4
PARSE-EXCEPTION: reference to undefined class 'string'
chained exception:
unhandled QORE System exception thrown in TID 1 at 2017-08-29 15:49:54.464712 Tue +02:00 (CEST) at test.q:4
PARSE-EXCEPTION: cannot cast<> to type 'object'
chained exception:
unhandled QORE System exception thrown in TID 1 at 2017-08-29 15:49:54.464712 Tue +02:00 (CEST) at test.q:4
PARSE-TYPE-ERROR: lvalue for assignment operator '=' expects type 'string', but right-hand side is type 'object'
this is a "feature", not a bug, since it is a "design bug" and casts never worked for anything other than classes / objects until 0.8.13, and the new cast updates only added support for complex types - however it will be easy to implement