-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
area:reportingError reporting including formatting, implicit suggestions, etcError reporting including formatting, implicit suggestions, etcbetter-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesIssues concerned with improving confusing/unhelpful diagnostic messagesitype:enhancement
Description
Compiler version
- 3.7.0
- 3.7.1-RC2
Minimized example
Welcome to Scala 3.7.1-RC2 (21.0.7, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
scala> trait A[B] { def f(x: String): B }
// defined trait A
scala> case class C(value: String)
// defined case class C
scala> val x: A[C] = C.apply _
1 warning found
-- Warning: --------------------------------------------------------------------
1 |val x: A[C] = C.apply _
| ^^^^^^^^^
| The syntax `<function> _` is no longer supported;
| you can simply leave out the trailing ` _`
val x: A[C] = Lambda/0x00000003015984c8@1d6a22dd
scala> val x: A[C] = C.apply
1 warning found
-- Warning: --------------------------------------------------------------------
1 |val x: A[C] = C.apply
| ^^^^^^^
|method apply is eta-expanded even though A[C] does not have the @FunctionalInterface annotation.
val x: A[C] = Lambda/0x00000003015c1400@68a94e58
Why this Error/Warning was not helpful
compiler report another warning if remove _
Metadata
Metadata
Assignees
Labels
area:reportingError reporting including formatting, implicit suggestions, etcError reporting including formatting, implicit suggestions, etcbetter-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesIssues concerned with improving confusing/unhelpful diagnostic messagesitype:enhancement