Skip to content

doc(context fun): fix example, add some more explanations #8394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 30, 2020

Conversation

robstoll
Copy link
Contributor

Note that the used syntax in the second example actually does not work (I have left a TODO)

@robstoll
Copy link
Contributor Author

robstoll commented Feb 28, 2020

I realised that given new Table doesn't compile. Intentionally?

@robstoll
Copy link
Contributor Author

I guess I misinterpreted the syntax and given T is actually a special shorthand for given T = new T() and not a creator application. Likewise class A(i : Int); given A(1) is short for given A = new A(1) correct?

if so then I have to update this PR and in this case I would suggest that it is mentioned in http://dotty.epfl.ch/docs/reference/contextual/givens.html

I would do the necessary with an additional commit.

Thoughts?

@odersky odersky self-assigned this Mar 23, 2020
Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes, this is great!

@robstoll
Copy link
Contributor Author

@odersky I removed the TODO as the syntax which previously did not work in scastie compiles perfectly fine in master (and now also on scastie):
6593929

@smarter smarter merged commit a0e5a8e into scala:master Mar 30, 2020
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.

4 participants