Skip to content

Polymorphic function with context bound still needs modularity  #22017

Closed
@bishabosha

Description

@bishabosha

Compiler version

3.6.2-RC1

Minimized code

import scala.math.Numeric.Implicits.given
val foo: [T: Numeric] => (t: T) => T = [T] => _ * Numeric[T].fromInt(3)

Output

-- [E040] Syntax Error: --------------------------------------------------------
2 |val foo: [T: Numeric] => (t: T) => T = [T] => _ * Numeric[T].fromInt(3)
  |           ^
  |           ']' expected, but ':' found

Expectation

should just work (right now you need to import scala.language.experimental.modularity)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions