Skip to content

(minor) usage of scala.ContextFunction0 should produce "context function types require at least one parameter" error #21321

@unkarjedy

Description

@unkarjedy

Scala 3.3.3

These 2 definitions are equivilent:

val v1: scala.ContextFunction0[String] = null
val v2: () ?=> String = null

The second one is a synthetic sugar for the first one.
The second second one reports error context function types require at least one parameter, but the first one compiles just fine which seem to make no sense.

I would be nice if the same error or a similar one was reported for the desugarred version of the context function type.

Metadata

Metadata

Assignees

Labels

area:context functionsIssues tied to context functions.area:reportingError reporting including formatting, implicit suggestions, etcbetter-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesitype:bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions