Earlier quoted context omitted.
Non-nullable This is incorrect, as is the announcement. The following is valid. class Bar{} let foo:object = new Bar() foo = null foo = undefined edit: For the people mentioning, --strictNullChecks. That applies to all types not just object. For example, "let x:string = null" would also be an error. That option applies to any type that is not of type Any/null/undefined, and has been in place since 2.0. In that way, "…
No, object is not a nullable type. For your code to work, you'd need to run it with strictNullChecks disabled. That's probably what you're doing, since it's the default.
Announcing TypeScript 2.2
11–20 of 123 posts
Re: Announcing TypeScript 2.2
#12My favorite: the new `object` type. Non-nullable and cannot refer to primitives.
Non-nullable This is incorrect, as is the announcement. The following is valid. class Bar{} let foo:object = new Bar() foo = null foo = undefined edit: For the people mentioning, --strictNullChecks. That applies to all types not just object. For example, "let x:string = null" would also be an error. That option applies to any type that is not of type Any/null/undefined, and has been in place since 2.0. In that way, "…
Re: Announcing TypeScript 2.2
#13Re: Announcing TypeScript 2.2
#14Re: Announcing TypeScript 2.2
#15Speaking of tooling -- has anyone had a good experience with Typescript in IntelliJ/Webstorm? It does a fantastic job figuring out ES6 code but seems to totally choke on Typescript. I'd like to avoid switching to Visual Studio.
Jump to definition/auto import/implement interface/etc all work.
Re: Announcing TypeScript 2.2
#16Speaking of tooling -- has anyone had a good experience with Typescript in IntelliJ/Webstorm? It does a fantastic job figuring out ES6 code but seems to totally choke on Typescript. I'd like to avoid switching to Visual Studio.
That's odd. I work in a 100% typescript shop and about half the devs use intellij and webstorm full time without much trouble. Jump to definition/auto import/implement interface/etc all work.
Re: Announcing TypeScript 2.2
#17Speaking of tooling -- has anyone had a good experience with Typescript in IntelliJ/Webstorm? It does a fantastic job figuring out ES6 code but seems to totally choke on Typescript. I'd like to avoid switching to Visual Studio.
> Select the Use TypeScript Service check box to get native support from the TypeScript Language Service according to the up-to-date specifications. In this case syntax and error highlighting is performed based on the annotations retrieved from the TypeScript Language Service while code completion lists contain both suggestions from the TypeScript Language Service and suggestions calculated by IntelliJ IDEA itself.
https://www.jetbrains.com/help/idea/2016.2/typescript-suppor...
Re: Announcing TypeScript 2.2
#18Earlier quoted context omitted.
Non-nullable This is incorrect, as is the announcement. The following is valid. class Bar{} let foo:object = new Bar() foo = null foo = undefined edit: For the people mentioning, --strictNullChecks. That applies to all types not just object. For example, "let x:string = null" would also be an error. That option applies to any type that is not of type Any/null/undefined, and has been in place since 2.0. In that way, "…
No, object is not a nullable type. For your code to work, you'd need to run it with strictNullChecks disabled. That's probably what you're doing, since it's the default.
It's not the default for the command line compiler. Also, all types (except Any/null/undefined) are non-nullable under that option, so that's not what makes object special (it's the no primitive types that is important).
>tsc test.ts
>tsc test.ts --strictNullChecks
> test.ts(3,1): error TS2322: Type 'null' is not assignable to type 'object'.Re: Announcing TypeScript 2.2
#19Speaking of tooling -- has anyone had a good experience with Typescript in IntelliJ/Webstorm? It does a fantastic job figuring out ES6 code but seems to totally choke on Typescript. I'd like to avoid switching to Visual Studio.