-
Notifications
You must be signed in to change notification settings - Fork 169
fix Error when calling abstract method on super() #1358 #1363
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
base: main
Are you sure you want to change the base?
Conversation
|
@yangdanny97 has imported this pull request. If you are a Meta employee, you can view this in D85364483. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly this looks good to me, but I'm a little concerned that
(a) the preexisting use of the word "stub" is misleading, and
(b) we need to double-check the behavior on actual stubs (as in, .pyi files)
| .map(|(idx, range)| (self.get_idx(*idx).arc_clone_ty(), *range)), | ||
| ); | ||
|
|
||
| if stub_or_impl == FunctionStubOrImpl::Stub { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: the name FunctionStubOrImpl::Stub is preexisting and goes against my request, but we can probably live with it for now - I may try to rename it later.
But related: @yangdanny97 do you know what happens if this is actually a "stub" in the sense of coming from a .pyi file?
In particular - will an actual stub from a .pyi file always have FunctionStubOrImpl::Impl rather than FunctionStubOrImpl::Stub?
It would be wrong for a stub to ever use Stub (that sentence explains exactly why the name Stub is probably the wrong name haha!), since for stubs we have to assume they imply an implementation exists, typically in native code.
We might want to add a test for that if we're not sure - this could throw a lot of false positives on actual .pyi files if we get it wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pyrefly/pyrefly/lib/binding/function.rs
Line 477 in 01f0a29
| FunctionStubOrImpl::Stub |
This is where it's set, I don't think it considers the type of module, only whether it has a proper body or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review automatically exported from Phabricator review in Meta.
fix #1358