We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ca0976 commit d6031baCopy full SHA for d6031ba
2 files changed
vlib/v/gen/js/js.v
@@ -872,8 +872,8 @@ fn (mut g JsGen) expr(node_ ast.Expr) {
872
g.gen_array_init_expr(node)
873
}
874
ast.AsCast {
875
- // skip: JS has no types, so no need to cast
876
// TODO: Is jsdoc needed here for TS support?
+ g.expr(node.expr)
877
878
ast.Assoc {
879
// TODO
vlib/v/gen/js/tests/casting.v
@@ -0,0 +1,6 @@
1
+type Type = string | bool
2
+
3
+fn main() {
4
+ t := Type('')
5
+ assert t is string && t == ''
6
+}
0 commit comments