Skip to content

Commit

Permalink
Fix TypeScript error with version 2.1.4
Browse files Browse the repository at this point in the history
See Wrong type with Promise chaining and 2.1.4 microsoft/TypeScript#12409
  • Loading branch information
tkrotoff committed Dec 14, 2016
1 parent e54b2b6 commit 1d0f8c6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions whatwg-fetch/whatwg-fetch-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,11 @@ function test_Body_json() {
fetch('http://test.com')
.then(response => response.json())
.then(fooBar => {
// fooBar is any, not FooBar
console.log(fooBar.foo);
console.log(fooBar.bar);
// fooBar is of type any, not of type FooBar

// FIXME Was behaving properly with TypeScript 2.0.10, not anymore with 2.1.4
// See Wrong type with Promise chaining and 2.1.4 https://github.com/Microsoft/TypeScript/issues/12409
//console.log(fooBar.foo);
//console.log(fooBar.bar);
});
}

0 comments on commit 1d0f8c6

Please sign in to comment.