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

type mismatch in complex return expressions #20

Open
Moinheart opened this issue Jan 8, 2016 · 5 comments
Open

type mismatch in complex return expressions #20

Moinheart opened this issue Jan 8, 2016 · 5 comments

Comments

@Moinheart
Copy link

I try to use Reactiveneo like this referred in README.md:

(TestNode( _.name := "Tom" ) :->: TestRelationship() :<-: TestNode()) .returns { case t1 ~~ r ~~ t2 ~~ _ => t1}

but there is a compile error in returns method:

type mismatch, expected: (PatternLink[TestNode, PatternLink[TestRelationship, PatternLink[TestNode, PNil]]]) => ReturnExpression[NotInferedURT], actual: (PatternLink[TestNode, PatternLink[TestRelationship, PatternLink[TestNode, PNil]]]) => GraphObject[GO, _]

and when i write returns { case t1 ~~ r ~~ t2 ~~ _ => r} or returns { case t1 ~~ r ~~ t2 ~~ _ => t2}, the error msg is:

type mismatch, expected: (PatternLink[TestNode, PatternLink[TestRelationship, PatternLink[TestNode, PNil]]]) => ReturnExpression[NotInferedURT], actual: (PatternLink[TestNode, PatternLink[TestRelationship, PatternLink[TestNode, PNil]]]) => Pattern

Could you help me solve this problem?

@Moinheart
Copy link
Author

it seems that the function of chaining returns is not supported yet.

@alexflav23
Copy link
Member

Hi @Moinheart,

I think we don't support chaining properly yet, or some implicits are missing, the only thing that's off is the return type of the construct but the hierarchy is well defined. @bjankie1 this is your territory, any suggestions here?

Regards,
Flavian

@bjankie1
Copy link
Contributor

I'm looking into that.

Regards,
Bartosz

On Mon, 11 Jan 2016 at 13:48 Flavian Alexandru [email protected]
wrote:

Hi @Moinheart https://github.com/Moinheart,

I think we don't support chaining properly yet, or some implicits are
missing, the only thing that's off is the return type of the construct but
the hierarchy is well defined. @bjankie1 https://github.com/bjankie1
this is your territory, any suggestions here?

Regards,
Flavian


Reply to this email directly or view it on GitHub
#20 (comment)
.

@bjankie1
Copy link
Contributor

The easiest way to resolve it for now is to instruct Scala to apply certain
order of operators:

returns { case (t1 ~~ (r ~~ t2)) => r}
I think reactiveneo code could be improved by changing ~~ to an operator
that takes the correct precedence.

Regards,
Bartosz

On Tue, 12 Jan 2016 at 21:59 Bartosz Jankiewicz <
[email protected]> wrote:

I'm looking into that.

Regards,
Bartosz

On Mon, 11 Jan 2016 at 13:48 Flavian Alexandru [email protected]
wrote:

Hi @Moinheart https://github.com/Moinheart,

I think we don't support chaining properly yet, or some implicits are
missing, the only thing that's off is the return type of the construct but
the hierarchy is well defined. @bjankie1 https://github.com/bjankie1
this is your territory, any suggestions here?

Regards,
Flavian


Reply to this email directly or view it on GitHub
#20 (comment)
.

@Moinheart
Copy link
Author

@bjankie1 the first solution that you suggest doesn't work in the test case.
And how to modify object ~~ to an operator? I've read the code and attempted to do it, but not in the right way. Could you give me more details of it or help fix it perhaps?
Thanks for your suggestions in this issue.

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

No branches or pull requests

3 participants