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

Fix generated usings in inherited interfaces #895

Merged
merged 2 commits into from
Apr 8, 2020
Merged

Fix generated usings in inherited interfaces #895

merged 2 commits into from
Apr 8, 2020

Conversation

Dreamescaper
Copy link
Contributor

@Dreamescaper Dreamescaper commented Apr 7, 2020

What kind of change does this PR introduce?
Fixes #892

What is the current behavior?
If we have InterfaceB inheriting InterfaceA, during generation of InterfaceB we include all methods from InterfaceA. However - usings are not accounted, therefore if InterfaceA requires some using directive, that is not present in InterfaceB file, generated file will be broken.

What is the new behavior?
Take all using directives from InterfaceA file to generated InterfaceB implementation.

What might this PR break?
Technically it might lead to similar issue as #784. Including usings from several files might lead to conflicts.
However, in this case it applies only to inherited types, so probability is much lower.
Not sure if we can fully handle that without full semantic analysis.

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

@@ -370,6 +372,16 @@ string GetInterfaceName(SyntaxToken identifier)
public class UsingDeclaration
{
public string Item { get; set; }

public override bool Equals(object obj)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added Equals and GetHashCode so that Union above would work properly.

@Sergio0694
Copy link
Contributor

This was super quick, thank you @Dreamescaper!
Also it's great to see the fix itself was indeed very small too 😄

@clairernovotny clairernovotny merged commit 0b38c6d into reactiveui:master Apr 8, 2020
@Dreamescaper Dreamescaper deleted the fix_inherited_usings branch April 8, 2020 13:32
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] 5.0.23 to 5.1.54 update causes build errors (missing using directives in stub)
3 participants