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

Need use base type property get method when the override property is internal #22560

Closed
huanwu opened this issue Jun 29, 2017 · 0 comments
Closed
Assignees
Milestone

Comments

@huanwu
Copy link
Contributor

huanwu commented Jun 29, 2017

When serialize the following derived type, it will throw “access method DerivedTypeWithDifferentOverrides.get_Name4() failed”. This is because the generated code is wrong and it try to access the internal Name4 property.

public class BaseType
{
    public virtual string Name1 { get; set; }
    public string Name2 { get; set; }
    public string Name3 { get; set; }
    public string Name4 { get; set; }
    public string @Name5 { get; set; }
}

public class DerivedTypeWithDifferentOverrides : BaseType
{
    public override string Name1 { get; set; }
    new public string Name2 { get; set; }
    new public string Name3 { get; set; }
    new internal string Name4 { get; set; }
    new public string Name5 { get; set; }
}
@huanwu huanwu self-assigned this Jun 29, 2017
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.1.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants