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

Query: Navigation rewrite does not preserve the type of result #15535

Closed
smitpatel opened this issue Apr 30, 2019 · 1 comment
Closed

Query: Navigation rewrite does not preserve the type of result #15535

smitpatel opened this issue Apr 30, 2019 · 1 comment
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-bug
Milestone

Comments

@smitpatel
Copy link
Contributor

Failing test
FindSqlServerTestNonGeneric.Find_base_type_using_derived_set_tracked_async
When we do FindAsync, we generate FirstOrDefault<object>, That information has to be flown to translation pipeline so our final result is of type Task<object> (Our Async contract just takes TResult now). Nav expansion is eating up that type somehow so our final result is of type Task<DerivedType> which cannot be used to return Task<object>. (This works for sync because of implicit casting).

@ajcvickers ajcvickers added this to the 3.0.0 milestone May 3, 2019
maumar added a commit that referenced this issue Jun 4, 2019
…of result

Problem was that we were only storing generic method definition for cardinality reducing operators (First/Single) because nav rewrite changes source types a lot.
However, those operators are applied after pending selector, so they are guaranteed to be of the same type as originally. We only need to track the changes that happen e.g. during member pushdown, e.g.:
customers.FirstOrDefault<Customer>().Id is changed to customers.Select(c => c.Id).FirstOrDefault<int>()
maumar added a commit that referenced this issue Jun 4, 2019
…of result

Problem was that we were only storing generic method definition for cardinality reducing operators (First/Single) because nav rewrite changes source types a lot.
However, those operators are applied after pending selector, so they are guaranteed to be of the same type as originally. We only need to track the changes that happen e.g. during member pushdown, e.g.:
customers.FirstOrDefault<Customer>().Id is changed to customers.Select(c => c.Id).FirstOrDefault<int>()
maumar added a commit that referenced this issue Jun 4, 2019
…of result

Problem was that we were only storing generic method definition for cardinality reducing operators (First/Single) because nav rewrite changes source types a lot.
However, those operators are applied after pending selector, so they are guaranteed to be of the same type as originally. We only need to track the changes that happen e.g. during member pushdown, e.g.:
customers.FirstOrDefault<Customer>().Id is changed to customers.Select(c => c.Id).FirstOrDefault<int>()
@maumar maumar added the type-bug label Jun 4, 2019
maumar added a commit that referenced this issue Jun 5, 2019
…of result

Problem was that we were only storing generic method definition for cardinality reducing operators (First/Single) because nav rewrite changes source types a lot.
However, those operators are applied after pending selector, so they are guaranteed to be of the same type as originally. We only need to track the changes that happen e.g. during member pushdown, e.g.:
customers.FirstOrDefault<Customer>().Id is changed to customers.Select(c => c.Id).FirstOrDefault<int>()
@maumar
Copy link
Contributor

maumar commented Jun 5, 2019

fixed in db9bca3

@maumar maumar closed this as completed Jun 5, 2019
@maumar maumar added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Jun 5, 2019
@ajcvickers ajcvickers modified the milestones: 3.0.0, 3.0.0-preview7 Jul 2, 2019
@ajcvickers ajcvickers modified the milestones: 3.0.0-preview7, 3.0.0 Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-bug
Projects
None yet
Development

No branches or pull requests

3 participants