Skip to content

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

Closed
@huanwu

Description

@huanwu

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; }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions