Skip to content

Conversation

@som-snytt
Copy link
Contributor

Fixes #10882


class GivenIntBox2(using givenInt: Int):
given Int = givenInt
//def n = summon[Int] // ambiguous
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation! Maybe we can use given Int = 42 here? Otherwise one might argue that semantically there is no ambiguity -- only the compiler complains about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting point. My idea was that if you want to "export givenInt" as a given, you might try it this way.

@b-studios b-studios merged commit feabdf0 into scala:master May 27, 2021
@som-snytt som-snytt deleted the issue/10882 branch May 27, 2021 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document using parameters on classes can provide given instances

2 participants