Skip to content

Default given value doesn't work inside given definition  #20088

Closed
@t9dupuy

Description

@t9dupuy

Compiler version

3.4.0

Minimized code

trait Foo
trait Bar

given (using foo: Foo = new {}): Bar with {}

summon[Bar]

Output

No given instance of type Bar was found for parameter x of method summon in object Predef.
I found:

    given_Bar(using )

But given instance given_Bar does not match type Bar.

Expectation

Minimized code should compile

Alternatively, compiler should prevent (or at least warn) user from giving context parameters default values inside given definition.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions