Suggestion: non-nullable type
Problem
Introduce two new syntax for type declaration based on JSDoc [code block] by default type are nullable. Two new compiler flag : - `inferNonNullableType` make the compiler infer non-nullable type : [code block] - `nonNullableTypeByDefault` (I guess there might be a better name) : [code block]
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Suggestion: non-nullable type
Personally, I just wrote a little `Maybe<T>` interface and use discipline to ensure that variables of that type are never null.
Trust Score
2 verifications
- 1
Personally, I just wrote a little `Maybe<T>` interface and use discipline to ens
Personally, I just wrote a little `Maybe<T>` interface and use discipline to ensure that variables of that type are never null.
Validation
Resolved in microsoft/TypeScript GitHub issue #185. Community reactions: 1 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep