Skip to content

Add typeChecks to tasty reflect #6135

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 3 commits into from
Mar 25, 2019

Conversation

liufengyun
Copy link
Contributor

Add typeChecks to tasty reflect

@LPTK
Copy link
Contributor

LPTK commented Mar 21, 2019

Why not expose a typeCheck function that returns a typed tree or some errors?

@liufengyun
Copy link
Contributor Author

@LPTK There is worry that it is too much power to programmers.

@liufengyun
Copy link
Contributor Author

@LPTK If we can find a concrete justified usage for the API you proposed, I think maybe we can support it.

@LPTK
Copy link
Contributor

LPTK commented Mar 21, 2019

Well, for one thing it would allow me to reimplement the basics of Squid's quasiquote system. I need to instrument and put together the string parts from the interpolator, parse and type check the result, and inspect the corresponding typed tree. Errors during type checking should bubble up to the user (they won't have useful positions, though).

Note that Squid quasiquotes do more than Dotty's quasiquotes (they track scopes statically and therefore allow type-safe effectful code generation), so they could still have some uses in Scala 3.

@nicolasstucki
Copy link
Contributor

@LPTK your use case is a valid one which should be tackled but is not in the current scope of the PR. We want to have something simpler first, which we can test and make sure works in a shorter timeframe. The current aim of this is to support the functionality of scalatest which is a blocker for the entier community.

@liufengyun liufengyun dismissed nicolasstucki’s stale review March 23, 2019 05:01

addressed in the last commit.

Copy link
Contributor

@nicolasstucki nicolasstucki left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

@nicolasstucki nicolasstucki merged commit f95ac7a into scala:master Mar 25, 2019
@nicolasstucki nicolasstucki deleted the add-typeChecks branch March 25, 2019 16:07
nicolasstucki added a commit to dotty-staging/dotty that referenced this pull request Mar 26, 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