{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/185","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/185/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/185/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/185/events","html_url":"https://github.com/Microsoft/TypeScript/issues/185","id":38371438,"number":185,"title":"Suggestion: non-nullable type","user":{"login":"fdecampredon","id":864201,"avatar_url":"https://avatars.githubusercontent.com/u/864201?v=3","gravatar_id":"","url":"https://api.github.com/users/fdecampredon","html_url":"https://github.com/fdecampredon","followers_url":"https://api.github.com/users/fdecampredon/followers","following_url":"https://api.github.com/users/fdecampredon/following{/other_user}","gists_url":"https://api.github.com/users/fdecampredon/gists{/gist_id}","starred_url":"https://api.github.com/users/fdecampredon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fdecampredon/subscriptions","organizations_url":"https://api.github.com/users/fdecampredon/orgs","repos_url":"https://api.github.com/users/fdecampredon/repos","events_url":"https://api.github.com/users/fdecampredon/events{/privacy}","received_events_url":"https://api.github.com/users/fdecampredon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Needs%20Proposal","name":"Needs Proposal","color":"556b75"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Suggestion","name":"Suggestion","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":156,"created_at":"2014-07-22T06:01:58Z","updated_at":"2015-01-27T03:18:21Z","closed_at":null,"body":"Introduce two new syntax for type declaration based on JSDoc\r\n\r\n```typescript\r\nvar myString: !string = 'hello world'; //non-nullable\r\nvar myString1: ?string = 'hello world'; // nullable \r\nvar myString2: string = 'hello world'; // nullable \r\nvar myString3 = 'hello world'; // nullable\r\n```\r\nby default type are nullable.\r\n\r\nTwo new compiler flag : \r\n* `inferNonNullableType` make the compiler infer non-nullable type  : \r\n```typescript\r\nvar myString3 = 'hello world' // typeof myString is '!string', non-nullable\r\n```\r\n* `nonNullableTypeByDefault` (I guess there might be a better name) : \r\n```typescript\r\nvar myString: !string = 'hello world'; // non-nullable\r\nvar myString1: string = 'hello world'; // non-nullable \r\nvar myString2: ?string = 'hello world'; // nullable \r\nvar myString3 = 'hello world' // non-nullable\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/71583605","html_url":"https://github.com/Microsoft/TypeScript/issues/185#issuecomment-71583605","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/185","id":71583605,"user":{"login":"danquirk","id":7121557,"avatar_url":"https://avatars.githubusercontent.com/u/7121557?v=3","gravatar_id":"","url":"https://api.github.com/users/danquirk","html_url":"https://github.com/danquirk","followers_url":"https://api.github.com/users/danquirk/followers","following_url":"https://api.github.com/users/danquirk/following{/other_user}","gists_url":"https://api.github.com/users/danquirk/gists{/gist_id}","starred_url":"https://api.github.com/users/danquirk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danquirk/subscriptions","organizations_url":"https://api.github.com/users/danquirk/orgs","repos_url":"https://api.github.com/users/danquirk/repos","events_url":"https://api.github.com/users/danquirk/events{/privacy}","received_events_url":"https://api.github.com/users/danquirk/received_events","type":"User","site_admin":false},"created_at":"2015-01-27T03:18:21Z","updated_at":"2015-01-27T03:18:21Z","body":"_New typing will break old code, that will happen anyway._\r\n\r\nThis is not the case. Except for exceptional circumstances we would not be adding new features that break existing code. Generics and unions weren't added to lib.d.ts in such a way that requires consumers of lib.d.ts to update their codebase in order to use the new version of the compiler. Yes people could choose to use an older version of the library but it's simply not the case that we're going to take language changes that break lots of existing code (as is the case for essentially all major languages). There will be the occasional exception to this (https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes) but they will be few and far between, most often if we believe the code we're breaking could only be a bug."}}