8000 Support minus sign in project names by Duhemm · Pull Request #8168 · sbt/sbt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support minus sign in project names #8168

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
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Duhemm
< 8000 /span> Copy link
Contributor
@Duhemm Duhemm commented Jun 26, 2025

Previously, sbt would crash when attempting to load a build where projects had minus signs (-) in their name.

For instance, when trying to load a project defined like this:

lazy val `my-project` = project

After compilation, this definition looks somewhat like this

val my$minusproject$lzy1 = ...

sbt was attempting to retrieve the original definition (without the $lzy suffix) by taking the mangled name up to the first $. Unfortunately, this approach does not work when the name includes special characters like a minus sign, because these will be prefixed with $ as well. In the current example, sbt would then try to find the member named my, fail, and crash.

This patch fixes the issue by using the "underlying" name, which is the name without the additional information.

Previously, sbt would crash when attempting to load a build where
projects had minus signs (`-`) in their name.

For instance, when trying to load a project defined like this:

    lazy val `my-project` = project

After compilation, this definition looks somewhat like this

    val my$minusproject$lzy1 = ...

sbt was attempting to retrieve the original definition (without the $lzy
suffix) by taking the mangled name up to the first `$`. Unfortunately,
this approach does not work when the name includes special characters
like a minus sign, because these will be prefixed with `$` as well. In
the current example, sbt would then try to find the member named `my`,
fail, and crash.

This patch fixes the issue by using the "underlying" name, which is the
name without the additional information.
@Duhemm Duhemm force-pushed the mduhem/name-dash branch from 76ec728 to 79dbcd2 Compare June 26, 2025 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0