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 REPL clashing with CWD artefacts #14021

Merged
merged 1 commit into from
Dec 13, 2021
Merged

Commits on Dec 2, 2021

  1. Fix REPL clashing with CWD artefacts

    This reverts the change that moves all the REPL's artefacts into the
    "repl$" package, moving everything back to the empty package.
    
    Then it fixes the class name and package name shadowing issue, by
    simulating what the batch compiler does when it compiles a source file
    without a package statement: it considers the sources to be in the empty
    package.  Then the imports for the previous runs and the user-defined
    imports will be in sub-contexts of the empty package.
    
    The reason the working directory artefacts were shadowing the REPL
    artefacts was because before the imports were being added to
    sub-contexts of the root package, afterwhich the REPL tree was being
    wrapped in the empty package.  That meant that the classes found in the
    empty package (i.e. classfiles in the working directory, or even
    directories) had precedence over the wildcard imports for the previous
    runs.
    
    The tests now cascade up into contexts that don't have the current
    compilation unit stored on them, so I had to safeguard against that in
    Typer.
    
    Also, I developed a variant of ShadowingTests, using the batch compiler,
    to automate the expectations of how the shadowing should and shouldn't
    work.
    dwijnand committed Dec 2, 2021
    Configuration menu
    Copy the full SHA
    83633a9 View commit details
    Browse the repository at this point in the history