- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.1k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version: nightly (2.1.0-dev.20160918)
Code
class A {
    json(): Promise<any> {
        return Promise.resolve({});
    };
}
function test() {
    let p = Promise.resolve(new A());
    p.then(x => x.json()).then(x => x.b);
}Expected behavior:
Compiled without errors
Actual behavior:
Compiled with an error
error TS2339: Property 'b' does not exist on type 'A'.
wizzard0, doxiaodong, jwbay, akdor1154, Offirmo and 8 more
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue