jsgen: fix casting (fix #24512) (#24519)

This commit is contained in:
Gonzalo Chumillas 2025-05-19 14:35:22 +01:00 committed by GitHub
parent 6ca0976896
commit d6031bae10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View file

@ -872,8 +872,8 @@ fn (mut g JsGen) expr(node_ ast.Expr) {
g.gen_array_init_expr(node)
}
ast.AsCast {
// skip: JS has no types, so no need to cast
// TODO: Is jsdoc needed here for TS support?
g.expr(node.expr)
}
ast.Assoc {
// TODO

View file

@ -0,0 +1,6 @@
type Type = string | bool
fn main() {
t := Type('')
assert t is string && t == ''
}