Files
ValueScript/inputs/passing/const/mutableSucallsOfWrappedExprs.ts
Andrew Morris add823ca55 Fix test
2024-03-01 10:01:03 +11:00

25 lines
394 B
TypeScript

//! test_output(3)
export default function main() {
let counter = new Counter();
counter.inc();
// This syntax breaks when jsx is enabled. It's highly unusual and might be removed from
// ValueScript entirely.
// (<Counter> counter).inc();
counter!.inc();
(counter as Counter).inc();
return counter.value;
}
class Counter {
value = 0;
inc() {
this.value++;
}
}