In Java all non-primitive variables are 'nullable', this is not so in TS in strict mode.
If some (field or variable) is declared as
foo: string;
You cannot just assign null or undefined to foo.
To be compatible it should look like
foo: string | null = null;
or
foo?: string | null;
The same applies to all no-primitive function return types - they are nullable. Well propper implementation could include some analysis - if the code actually can return null.
Also "meta" informations like this (also not valid in ts strict mode):
SomeClass["__class"] = "my.package.ParsedDateFormat";
may be done like this
static __class = "my.package.ParsedDateFormat"
but in class body.
In Java all non-primitive variables are 'nullable', this is not so in TS in strict mode. If some (field or variable) is declared as
foo: string;
You cannot just assign null or undefined tofoo
. To be compatible it should look likefoo: string | null = null;
orfoo?: string | null;
The same applies to all no-primitive function return types - they are nullable. Well propper implementation could include some analysis - if the code actually can return null. Also "meta" informations like this (also not valid in ts strict mode):SomeClass["__class"] = "my.package.ParsedDateFormat";
may be done like thisstatic __class = "my.package.ParsedDateFormat"
but in class body.