zephir-lang / zephir

Zephir is a compiled high-level language aimed to ease the creation of C-extensions for PHP
https://zephir-lang.com
MIT License
3.3k stars 466 forks source link

Support cast in var. #1841

Open joeyhub opened 5 years ago

joeyhub commented 5 years ago

If I do var x = (int)(a - b); I get unknown type, cast. It seems to just be hoping for a literal type or something (somehow magically works for function calls though).

Anonymous functions also don't seem to take a return type. Similarly float x = expr gives me strange results like unknown type, list.

dschissler commented 5 years ago

Maybe Zephir needs to borrow a complex operator test kit from another language to see if things should be changed.