new keyword and hidden inherited members

Issue #131 new
Alex Muirhead
created an issue

So whilst I agree that hiding an inherited member is often a nasty thing, I've got some code where it's been doing just that!

Just to clarify that means I've some C# classes like:

public class ClassA 
   public object Data { get; set; }

public class ClassB : ClassA
   public new string Data { get; set; }

this results in uncompilable typescript:

Interface 'ClassB' incorrectly extends interface 'ClassA'. Types of property 'data' are incompatible.

A simple enough work around is to manually annotate exclude any properly which hides an inherited member, but I was wondering if anyone had any better suggestions?

At the moment I'm having to pollute the model with the [TsIgnore] attributes. Would a pull request which gives the ability to have say WithClassMemberFilter and add some methods in the TsGenerator class be welcomed?

Comments (1)

  1. Log in to comment