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

Proposal: allow erased to be used in place of a definition #11736

Closed
japgolly opened this issue Mar 15, 2021 · 4 comments
Closed

Proposal: allow erased to be used in place of a definition #11736

japgolly opened this issue Mar 15, 2021 · 4 comments

Comments

@japgolly
Copy link
Contributor

Instead of:

erased given CanThrow[Ex1] = ???

which is confusing to newbies and requires even experienced users to take a deep breath, what do you think about allowing the erased keyword itself to stand in as a fake definition? It would look like this:

erased given CanThrow[Ex1] = erased
@japgolly
Copy link
Contributor Author

If the above is acceptable, then a potential next step could be to have to compiler apply the erased flag to any definition with erased as the body,

given CanThrow[Ex1] = erased

@nicolasstucki
Copy link
Contributor

We already have this feature.

It is exposed as the method scala.compiletime.erasedValue.

erased given CanThrow[Ex1] = erasedValue

@abgruszecki
Copy link
Contributor

@nicolasstucki I guess this issue can be closed then, no?

@japgolly
Copy link
Contributor Author

Linking to #11739

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants