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

fix #275 - quotation: add identifier method to avoid wrong type refinement inference #280

Merged
merged 3 commits into from
Mar 16, 2016

Conversation

fwbrasil
Copy link
Collaborator

Fixes #275

Problem

The quotation mechanism uses a type refinement with an annotation to store the AST. The scala compiler considers two type refinements equal if they have the same signature, which doesn't include annotations. This makes the quotation infer the wrong AST for some dynamic query compositions.

Solution

Add an identifier method to the quotation to make the type refinements different from the scala compiler's perspective.

Notes

The method name will have up to 12 characters, so we shouldn't hit any method name limit.

Checklist

  • Unit test all changes
  • Update README.md if applicable
  • Add [WIP] to the pull request title if it's work in progress
  • Squash commits that aren't meaningful changes
  • Run sbt scalariformFormat to make sure that the source files are formatted

@getquill/maintainers

@jilen
Copy link
Collaborator

jilen commented Mar 16, 2016

👍 Works like a charm

Approved with PullApprove

@godenji
Copy link
Contributor

godenji commented Mar 16, 2016

👍

Approved with PullApprove

1 similar comment
@jilen
Copy link
Collaborator

jilen commented Mar 16, 2016

👍

Approved with PullApprove

@lvicentesanchez
Copy link
Contributor

👍

Approved with PullApprove

fwbrasil added a commit that referenced this pull request Mar 16, 2016
fix #275 - quotation: add identifier method to avoid wrong type refinement inference
@fwbrasil fwbrasil merged commit ac40e0a into master Mar 16, 2016
@fwbrasil fwbrasil deleted the fix-275 branch March 16, 2016 14:45
jilen pushed a commit that referenced this pull request Jun 11, 2024
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