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

Support changing the base type of a class to a child of the original #9

Open
sharwell opened this issue Dec 16, 2014 · 2 comments
Open

Comments

@sharwell
Copy link
Member

The following transformation shouldn't be considered a breaking change, but the current implementation is "too strict" and treats all changes to the base type as a breaking change.

Before:

public class Foo
{
}

public class Bar
{
}

After:

public class Foo
{
}

public class Bar : Foo
{
}
@ArcEarth
Copy link

ArcEarth commented Jun 1, 2017

A stranger examples here:
This will not break APIL

API before change:

class Foo
{
    public virtual void Bar() {}
    public virtual void Baz() {}
}

API after change:

class FooBase
{
    public virtual void Bar() {}
}

class Foo : FooBase
{
    public virtual void Baz() {}
}

@sharwell
Copy link
Member Author

Note that there is a subtle class of breaking changes here related to dotnet/csharplang#409, but it should still typically be allowed.

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

No branches or pull requests

2 participants