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

Unify output field node type when selecting by field type #91

Open
alonsodomin opened this issue Sep 19, 2017 · 0 comments
Open

Unify output field node type when selecting by field type #91

alonsodomin opened this issue Sep 19, 2017 · 0 comments

Comments

@alonsodomin
Copy link
Owner

At the moment, when having a parsed CRON expression and selecting one of its fields by it's CronField type, the return type is a path-dependent type result of the machinery used to do this selection in a type-safe way:

scala> cron.field[CronField.Second]
res0: cron4s.expr.FieldSelector.SecondsFromCronExpr.Out[CronField.Second] = 8

This in contrast to the return type obtained when selecting by the field accessor:

scala> cron.seconds
res1: cron4s.expr.SecondsNode = 8

In the first case, the path-dependent type is an useless artifact since right after obtaining the reference to the field, we can't do much more with other than printing it's expression.

The type of field[CronField] should unify to the actual type of the node, otherwise that operation has very little sense to exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant