jsweet
jsweet copied to clipboard
Java `final` modifier should transpile to TS `const` or `readonly`
If I have a Java class like
public class Test {
public static final int one = 1;
}
JSweet will turn this into
class Test {
public static one: number = 1;
}
I expect Test.one = 2
to fail, obviously. In the original Java, it does, but in the generated TS it does not.
ETA: to be clear, I'd like to see the generated class come out as
class Test {
public static readonly one: number = 1;
}
+1 Readonly modifier did not exist at the beginning but now we could do so. Do you want to contribute? It is an easy one
I was afraid you'd say that... is this the same reason why private transpiles to /* private */
instead of actually using the private keyword? Same as last time, if I have some free time to figure out the internals enough to make the change myself, I'll let you know. Thanks!