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

check types when parsing assignments and equality operations #532

Merged
merged 1 commit into from
Aug 24, 2016

Conversation

fwbrasil
Copy link
Collaborator

Fixes #446, #200

Problem

Assignments and equality operations don't check the types of the terms.

Solution

Check types during parsing.

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 test:scalariformFormat to make sure that the source files are formatted

@getquill/maintainers

@jilen
Copy link
Collaborator

jilen commented Aug 23, 2016

Shall we support equality for option type like Option[Int] == Int ?

@fwbrasil
Copy link
Collaborator Author

@jilen forall should be the correct solution for this case: option.forall(_ == value), no?

@jilen
Copy link
Collaborator

jilen commented Aug 23, 2016

@fwbrasil Yes, forall looks good to me

@gustavoamigo
Copy link
Contributor

gustavoamigo commented Aug 23, 2016

👍

Approved with PullApprove

@fwbrasil fwbrasil force-pushed the typesafe-parsing branch 2 times, most recently from 78d151d to 6ee1a0c Compare August 24, 2016 06:48
@fwbrasil
Copy link
Collaborator Author

The build should pass now. I've removed from the readme the examples of actions that use column queries, since they don't type check. I'll open an issue to reintroduce them after option.get is supported.

@jilen
Copy link
Collaborator

jilen commented Aug 24, 2016

👍

Approved with PullApprove

@gustavoamigo
Copy link
Contributor

👍

@fwbrasil fwbrasil merged commit d4ac411 into master Aug 24, 2016
@fwbrasil fwbrasil deleted the typesafe-parsing branch August 24, 2016 13:58
@fwbrasil fwbrasil mentioned this pull request Aug 24, 2016
@zifeo
Copy link
Contributor

zifeo commented Aug 27, 2016

forall seems good for equality, but what about inserts or updates? When having lots of optional values, accepting Option[T] == T was a huge gain in readability. What would you suggest in order to keep this benefit?

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