Re: New (optional) AS3 compiler feature: Type inference

2023-06-20 Thread Josh Tynjala
I think it would be feasible for vscode-as3mxml to provide a quick fix to convert the inferred type into an explicitly declared type, if that's what you mean. I don't think that there's any other tool where it makes sense. The formatter, for instance, can see the type declarations, but it doesn't

Re: New (optional) AS3 compiler feature: Type inference

2023-06-20 Thread Harbs
Nice. I personally like explicit types because it’s more human readable. How feasable would it be to automatically add types to the code based on type inference. So var s = “hello” could be transformed to var s:String = “hello”. Do you need to assign the variable when it’s declared for this to

New (optional) AS3 compiler feature: Type inference

2023-06-20 Thread Josh Tynjala
Hi all, One cool feature in other languages similar to AS3, such as TypeScript or Haxe, is type inference. It allows developers to optionally omit a type declaration from a variable, or a function signature, by having the compiler automatically detect an appropriate type from context. For