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

Allow val defined as a const to be used as NES #137

Closed
wants to merge 1 commit into from

Conversation

Kordyjan
Copy link

This change allows references to values defined as non-empty constants to be used as NonEmptyStrings.
Works when the -Yretain-trees flag is enabled.

It can be taken further by applying the checks recursively, e.g., we can check make things like

val x = s"abc${"xyz"}"
val nes: NonEmptyString = x

or

val x = "ABC"
val y = "def"
val nes: NonEmptyString = s"$x$y"

work.

@lbialy
Copy link
Collaborator

lbialy commented Sep 21, 2023

@prolativ can you please add -YretainTrees to default setup of Scala-cli launcher, templates and a test?

@pawelprazak pawelprazak added kind/improvement An improvement with existing workaround resolution/fixed This issue was fixed area/api User visible API impact/usability Something that impacts users' ability to use the product easily and intuitively impact/first-48 This bug is likely to be hit during a user's first 48 hours of product evaluation and removed resolution/fixed This issue was fixed labels Sep 21, 2023
@prolativ
Copy link
Collaborator

@lbialy is this something we need for our initial release? I would opt for holding this a bit to do some experiments and see how this pattern might influence users' code

@lbialy
Copy link
Collaborator

lbialy commented Sep 21, 2023 via email

@pawelprazak pawelprazak added the awaiting-feedback Cannot progress until more feedback is gathered label Sep 25, 2023
@lbialy lbialy added this to the 0.2.0 milestone Jan 25, 2024
@pawelprazak pawelprazak removed this from the 0.2.0 milestone Jan 26, 2024
@pawelprazak pawelprazak added this to the 0.2.0 milestone Feb 7, 2024
@lbialy
Copy link
Collaborator

lbialy commented Feb 8, 2024

This is subsumed by #375. Thank you @Kordyjan for all the help with this!

@lbialy lbialy closed this Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api User visible API awaiting-feedback Cannot progress until more feedback is gathered impact/first-48 This bug is likely to be hit during a user's first 48 hours of product evaluation impact/usability Something that impacts users' ability to use the product easily and intuitively kind/improvement An improvement with existing workaround
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants