Skip to content

Better error reporting is required for inlined non-immutable paths #21538

Closed
@soronpo

Description

@soronpo

As discovered in #16804 and raised again in #17181 and #21536, it is clear that better error reporting is required to prevent further ticket opening, by suggesting to remove the inline from the dependent argument in the compiler error message.

Compiler version

v3.5.0

Minimized code

trait Bar[T]
given [T]: Bar[T] with {}
inline def foo[V](inline value: V)(using Bar[value.type]) : Unit = {} //error

Output

(value : V) is not a valid singleton type, since it is not an immutable path
inline def foo[V](inline value: V)(using Bar[value.type]) : Unit = {}

Expectation

The compiler should provide a hint to remove the inline keyword from the dependent value to resolve the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    SpreeSuitable for a future Spreearea:inlinearea:reportingError reporting including formatting, implicit suggestions, etcbetter-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesitype:enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions