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

REPL : pureFunctions and captureChecking fail with "language import only allowed at toplevel" #16250

Closed
rjolly opened this issue Oct 26, 2022 · 4 comments · Fixed by #22220
Closed
Assignees
Labels
area:experimental:cc Capture checking related area:repl cc-experiment Intended to be merged with cc-experiment branch on origin itype:bug

Comments

@rjolly
Copy link
Contributor

rjolly commented Oct 26, 2022

Compiler version

3.2.2-RC1-bin-SNAPSHOT-git-292e56f

Minimized code

scala> import language.experimental.captureChecking

Output

-- Error: ----------------------------------------------------------------------
1 |import language.experimental.captureChecking
  |                             ^^^^^^^^^^^^^^^
  |                      this language import is only allowed at the toplevel

Expectation

Should work. See f2c1b24

@rjolly rjolly added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Oct 26, 2022
@rjolly rjolly changed the title REPL : pureFunctions and captureChecking fail with language import only allowed at toplevel REPL : pureFunctions and captureChecking fail with "language import only allowed at toplevel" Oct 26, 2022
@dwijnand dwijnand added discussion cc-experiment Intended to be merged with cc-experiment branch on origin area:repl itype:bug and removed itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label discussion labels Oct 26, 2022
@anatoliykmetyuk
Copy link
Contributor

This issue was picked for the Issue Spree No. 23 of 08 November 2022 which takes place in a week from now. @rjolly, @mbovel will be working on it. If you have any insight into the issue or guidance on how to fix it, please leave it here.

@dwijnand
Copy link
Member

dwijnand commented Nov 1, 2022

Working on imports and the REPL is hard. I encountered this reality while working on PR #14021 and there's related history that touches on things like withRootImports and the CollectTopLevelImports phase.

@scala-center-bot
Copy link

This issue was picked for the Issue Spree No. 25 of 24 January 2023 which takes place in a week from now. @rjolly, @TheElectronWill will be working on it. If you have any insight into the issue or guidance on how to fix it, please leave it here.

@mbovel
Copy link
Member

mbovel commented Jan 17, 2023

#16304 is a work-in-progress PR for this issue, see comments there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:experimental:cc Capture checking related area:repl cc-experiment Intended to be merged with cc-experiment branch on origin itype:bug
Projects
None yet
7 participants