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

Fix messages leaking via suspended messages #13911

Merged
merged 1 commit into from
Nov 10, 2021

Commits on Nov 8, 2021

  1. Fix messages leaking via suspended messages

    It isn't clear what StoreReporter's purpose is.  Is it simply a store of
    all messages, or is it a store of "real" messages, i.e. messages that
    aren't suppressed with `@nowarn` or -Wconf (i.e. configurable warnings)?
    I believe StoreReporter is often used as a way to get programmatic
    access to the real messages.
    
    Typer, with its TyperState, uses StoreReporter as a more general buffer
    while making typing attempts, such as when trying to apply an implicit
    conversion.  But with configurable warnings, we don't know if a warning
    is real or not until we've typed all the `@nowarn` annotation in the
    code, which is why we suspend the messages, on Run.
    
    So we add an override for TyperState, so that StoreReporter is used as
    simply a buffer.  When it then unbuffers its messages in flush to the
    parent context's reporter, it will run through the regular
    "issueIfNotSuppressed" code (assuming it's not another store reporter).
    dwijnand committed Nov 8, 2021
    Configuration menu
    Copy the full SHA
    e5201a0 View commit details
    Browse the repository at this point in the history