Skip to content

Broken compilation when script name equals to library name #3595

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

Open
road21 opened this issue Mar 27, 2025 · 1 comment · May be fixed by #3647
Open

Broken compilation when script name equals to library name #3595

road21 opened this issue Mar 27, 2025 · 1 comment · May be fixed by #3647
Labels
bug Something isn't working scripting Issues tied to *.sc script inputs. wontfix This will not be worked on

Comments

@road21
Copy link

road21 commented Mar 27, 2025

Version(s)
1.6.1, 1.7.1

Describe the bug
In worksheet mode filename affects compilation.

To Reproduce

  1. Create file zio.sc with code:
//> using dep "dev.zio::zio:2.1.16"

import zio.ZIO
  1. Run: scala-cli zio.sc

Got:

[error] ./zio.sc:4:12
[error] value ZIO is not a member of zio$_
[error] import zio.ZIO
[error]            ^^^

Expected behaviour

No compiler errors.
In non-worksheet mode (if filename is zio.scala) the behavior is as expected.

@road21 road21 added the bug Something isn't working label Mar 27, 2025
@Gedochao Gedochao added the scripting Issues tied to *.sc script inputs. label Apr 2, 2025
@Gedochao Gedochao changed the title Broken compilation when worksheet name equals to library name Broken compilation when script name equals to library name Apr 2, 2025
@Gedochao Gedochao added the spree label Apr 2, 2025
@Gedochao Gedochao added wontfix This will not be worked on and removed spree labels Apr 29, 2025
@Gedochao
Copy link
Contributor

We will likely not be able to fix this use case fully, as it'd break other stuff.
For a full explanation, see the discussion under @yadavan88's draft PR:

However, the window is open for adding workarounds/doing UX improvements. I will leave the issue open for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working scripting Issues tied to *.sc script inputs. wontfix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants