Skip to content

🤖 User test baselines have changed#24247

Merged
sandersn merged 1 commit into
microsoft:masterfrom
typescript-bot:user-update-20180405
May 18, 2018
Merged

🤖 User test baselines have changed#24247
sandersn merged 1 commit into
microsoft:masterfrom
typescript-bot:user-update-20180405

Conversation

@typescript-bot
Copy link
Copy Markdown
Collaborator

Please review the diff and merge if no changes are unexpected.
You can view the build log here.

cc @weswigham @sandersn @mhegazy

@sandersn
Copy link
Copy Markdown
Member

@weswigham , looks like some order changes still remain. I thought they were fixed by now?

@weswigham
Copy link
Copy Markdown
Member

groans I'm not sorting by elaboration (or lack thereof) so an error that occurs on the exact same location but is only elaborated once is unstable. sigh

Though that brings up a decent point, imo: why aren't the errors deduped?

@sandersn
Copy link
Copy Markdown
Member

Um, might be a bug in our error reporting?

@weswigham
Copy link
Copy Markdown
Member

Looks like they're all assignability issues; I'm pretty sure we have OK reasons to check assignability a few times (even at the same place? Probably worth looking at...) - I think our deduplication logic just doesn't ignore elaborations when comparing errors?

@weswigham
Copy link
Copy Markdown
Member

@sandersn Here's a reduced example of the code causing the error:

// @ts-check
var A = {};
A.B = {};
/** @typedef {{o: string, y: number}} */
A.B.C = [
    {
        o: "no",
        y: 42
    },
    {
        o: "yes",
        y: 0
    }
];

/**
 * @returns {?A.B.C}
 */
function foo() {
    return A.B.C.find(x => !!x);
}

(The typedef is supposed to be pulling its name from the following assignment's LHS, but instead gets a parse error - then later in the function below we claim to return that type, but since the typedef fails, the odd js "falls back to the value type" behavior happens and we error because, ofc, an element of the array isn't assignable to the array itself)

Modifying the example like so:

// @ts-check
var A = {};
A.B = {};
/** @typedef {{o: string, y: number}} */
A.B.C = [
    {
        o: "no",
        y: 42
    },
    {
        o: "yes",
        y: 0
    }
];

A.B.Foo = class {
    /**
     * @returns {?A.B.C}
     */
    foo() {
        return A.B.C.find(x => !!x);
    }
}

causes the assignability error to be repeated! (Once with elaboration, once without)

@sandersn sandersn merged commit 9e19567 into microsoft:master May 18, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants