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 authored and greglo committed Dec 15, 2016
1 parent 4218e2e commit 46f56e3
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 46f56e3

Please sign in to comment.