Skip to content

Compute type of inherited constructor correctly #1376

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
wants to merge 1 commit into from

Conversation

rwbarton
Copy link
Contributor

Fixes #1246.

@JukkaL
Copy link
Collaborator

JukkaL commented Apr 13, 2016

Looks good -- assuming that the build passes :-)

@@ -359,6 +359,8 @@ def type_object_type(info: TypeInfo, builtin_type: Callable[[str], Instance]) ->
def type_object_type_from_function(init_or_new: FuncBase, info: TypeInfo,
fallback: Instance) -> FunctionLike:
signature = method_type_with_fallback(init_or_new, fallback)
signature = cast(FunctionLike,
map_type_from_supertype(signature, info, init_or_new.info))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really deserves a comment, doesn't it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, good point. Maybe some reasoning about why the cast is safe and a general description.

@rwbarton rwbarton force-pushed the rwbarton-init-type branch from aea1971 to 3003e50 Compare April 13, 2016 19:16
@rwbarton
Copy link
Contributor Author

Added some comments explaining what is going on here. I don't think the cast really needs a special mention once there is a comment giving the general picture.

@JukkaL
Copy link
Collaborator

JukkaL commented Apr 14, 2016

Rebased and pushed.

@JukkaL JukkaL closed this Apr 14, 2016
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

Successfully merging this pull request may close these issues.

2 participants