Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InvalidOperationException with empty stack on `Literal[True]` annotation #1640

Closed
jakebailey opened this issue Oct 7, 2019 · 1 comment · Fixed by #1650

Comments

@jakebailey
Copy link
Member

commented Oct 7, 2019

        [TestMethod, Priority(0)]
        public async Task LiteralParameter() {
            const string code = @"
from typing import Literal

def f(handle: int, overlapped: Literal[True]):
    pass
";
            var analysis = await GetAnalysisAsync(code);
            analysis.Should().HaveFunction("f")
                    .Which.Should().HaveSingleOverload()
                    .Which.Should().HaveParameters("handle", "overlapped");
        }

Crashes.

This is a simplified version of the changes added to _winapi's stub in the latest typeshed:

def ConnectNamedPipe(handle: int, overlapped: Literal[True]) -> Overlapped: ...
@jakebailey jakebailey added the bug label Oct 7, 2019
@jakebailey

This comment has been minimized.

Copy link
Member Author

commented Oct 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.