Skip to content
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

Use given for implicit parameters and arguments #5821

Closed
wants to merge 6 commits into from

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jan 30, 2019

Three syntax changes:

  1. Use given instead of with for implicit parameters and arguments.
  2. Write given A => B instead of A |=> B for implicit function types
  3. Write given x => e instead of x |=> e for implicit closuress.

@ghost ghost assigned odersky Jan 30, 2019
@ghost ghost added the review label Jan 30, 2019
@Blaisorblade
Copy link
Contributor

On master there's some code using the new with to update (from f079dd3).

The build failure can be reproduced most quickly by rebasing on master and running dotty-bootstrapped/testCompilation tasty-interpreter.

@biboudis
Copy link
Contributor

biboudis commented Jan 30, 2019

Hmm, it reports a syntax error also triggered by:

language-server/test/dotty/tools/languageserver/util/CodeTester.scala

Previously, `given ()`  was legal, but it serves no purpose and only complicates things.
Parser.syntaxError contains a tweak that underlines the whole span
of the current token, if it has a name. Tho make this work reliably
we need to reset the name to null when reading a new token, since not every
token sets a name.
It's `given A => B` instead of `A |=> B`.
# Conflicts:
#	tests/run-with-compiler-custom-args/tasty-interpreter/interpreter/TastyInterpreter.scala
#	tests/run-with-compiler-custom-args/tasty-interpreter/interpreter/TreeInterpreter.scala
@odersky
Copy link
Contributor Author

odersky commented Jan 31, 2019

Superseded by #5825

@odersky odersky closed this Jan 31, 2019
@ghost ghost removed the stat:needs review label Jan 31, 2019
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.

3 participants