Skip to content

_Node is wrong type annotation for validateOverwriteExistingEntity #620

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
srawlins opened this issue Jan 11, 2018 · 1 comment · Fixed by dart-archive/file.dart#66
Closed

Comments

@srawlins
Copy link
Member

I should not have used _Node. I didn't check with the analyzer, but it now says:

Analyzing lib...
  error • The argument type '(_DirectoryNode) → Null' can't be assigned to the parameter type '(_Node) → void' at lib/src/backends/memory/memory_directory.dart:76:9 • argument_type_not_assignable
@tvolkert
Copy link
Contributor

But here, we call validateOverwriteExistingEntity(child), where child is a _Node...

Let's back up. _RenameOverwriteValidator is defined here like so:

typedef void _RenameOverwriteValidator<T extends _Node>(T existingNode);

So in renameSync, we want the validateOverwriteExistingEntity argument to just be an instance of _RenameOverwriteValidator, with the type argument being any subclass of _Node. How do we express this?

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

Successfully merging a pull request may close this issue.

3 participants