Skip to content

generic method override error on return types #25183

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

Closed
jmesserly opened this issue Dec 9, 2015 · 5 comments
Closed

generic method override error on return types #25183

jmesserly opened this issue Dec 9, 2015 · 5 comments
Assignees
Labels
legacy-area-analyzer Use area-devexp instead. P1 A high priority bug; for example, a single project is unusable or has many test failures

Comments

@jmesserly
Copy link

Seen with latest Dart SDK containing today's fixes:

The return type 'V (/Users/jmesserly/src/dart/sdk/pkg/analyzer/lib/src/context/context.dart)' is not assignable to 'V (/Users/jmesserly/src/dart/sdk/pkg/analyzer/lib/src/generated/engine.dart)' as required by the method it is overriding from 'AnalysisContext'lib/src/context/context.dart, line 930

Given that the error message looks different from #25170, I think this one is coming from ErrorVerifier. It looks like it does not understand the return type of generic methods when it checks overrides. (not sure if parameters are working).

I'm seeing this on most (all?) generic methods overrides

@jmesserly jmesserly added P1 A high priority bug; for example, a single project is unusable or has many test failures legacy-area-analyzer Use area-devexp instead. analyzer-strong-mode labels Dec 9, 2015
@leafpetersen
Copy link
Member

Yeah, I think tackling the error verifier is a pretty high priority now. The functionality is getting into decent shape, but we're going to get lots of spurious warnings, and (less critically but still important) we'll be missing some useful warnings.

@jmesserly jmesserly self-assigned this Dec 9, 2015
@jmesserly
Copy link
Author

Agreed. Should we file another one to track warnings that we should add? In the meantime I'll take a shot at this one.

@jmesserly
Copy link
Author

Hmmm. It's in the same method so I might just go ahead and add some of the new errors/warnings (number of type parameters, bounds) based on: https://github.com/leafpetersen/dep-generic-methods/blob/master/proposal.md#function-subtyping

Trying to figure out what seems worth keeping there. I think a lot of this is subsumed by CodeChecker in strong mode (which does the subtype check), although it looks like we still need some parts of _checkForAllInvalidOverrideErrorCodes like the INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES check.

@leafpetersen
Copy link
Member

Sounds good to me. Tracking bug for the missing warnings filed here:

#25200

Feel free to add any that I forgot.

@jmesserly
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy-area-analyzer Use area-devexp instead. P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

2 participants