dotty-feature-requests icon indicating copy to clipboard operation
dotty-feature-requests copied to clipboard

Context Bound for Polymorphic Functions

Open bishabosha opened this issue 6 years ago • 1 comments

desugar val combine = [T: Semigroup] => (x: T) => (y: T) => x `combine` y to val combine = [T] => (x: T) => (y: T) => given (ev: Semigroup[T]) => x `combine` y i.e. a given parameter list before the body

bishabosha avatar Aug 05 '19 07:08 bishabosha

If we do this we might want to be even bolder and support the full syntax of methods, like @LPTK suggested a while ago: https://github.com/lampepfl/dotty/pull/4672#issuecomment-399009667

smarter avatar Aug 20 '19 19:08 smarter