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

Question: desugaring of named context bounds #22166

Open
Florian3k opened this issue Dec 9, 2024 · 0 comments
Open

Question: desugaring of named context bounds #22166

Florian3k opened this issue Dec 9, 2024 · 0 comments
Labels
area:desugar Desugaring happens after parsing but before typing, see desugar.scala itype:question

Comments

@Florian3k
Copy link
Contributor

Currently some tools in the ecosystem (certainly Scaladoc, possibly some others) rely on the fact that context bounds desugared to implicit/using parameters have names starting with evidence$.
Scaladoc detects such parameters and displays them as context bounds:
def foo[T]()(using evidence$1 : Bound[T]) -> def foo[T : Bound]()

With context bound desugared to names not starting with evidence$ this heuristic no longer works.
This has already became a problem after #22019 (also see #22069), but will be more serious one after modularity stops being experimental.

So my question is: Can we have some additional information attached to parameters that are created from desugaring context bounds?

This could be some kind of flag attached to ValDefs (maybe something like artifact/synthetic? not really sure here), or maybe some annotation, eg (using namedContextBound: Bound[T] : @contextBoundEvidence).

@Florian3k Florian3k added itype:question area:desugar Desugaring happens after parsing but before typing, see desugar.scala labels Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:desugar Desugaring happens after parsing but before typing, see desugar.scala itype:question
Projects
None yet
Development

No branches or pull requests

1 participant