Skip to content

Question: desugaring of named context bounds #22166

Open
@Florian3k

Description

@Florian3k

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:desugarDesugaring happens after parsing but before typing, see desugar.scalaitype:question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions