Not compilable statement

22 views
Skip to first unread message

zdenek hostinsky

unread,
Jun 17, 2015, 2:29:50 AM6/17/15
to shar...@googlegroups.com
Hello

in fact by mistake I found one of not supported statements to compile


public class Parent<T>
{
protected T _data;
}


[JsType(JsMode.ExtJs, InlineFields = true)]
public class Child : Parent<Child.InitialData>
{
public class InitialData
{
public int QuestionerID { get; set; }
}

public void doSmth()
{
var i = _data.QuestionerID + 1;
}
}

not sure how mig problem it is as solution is simle - take the InitialData out of the class


another problem I would like to discuss is this one


[JsType(JsMode.ExtJs, InlineFields = true)]
public class Parent
{
private int _privateMember = 0;

public void doSmthOnParent()
{
_privateMember++;
HtmlContext.console.info(_privateMember);
}
}


[JsType(JsMode.ExtJs, InlineFields = true)]
public class Child : Parent
{

private int _privateMember = 0;
public void doSmthOnChild()
{
_privateMember++;
HtmlContext.console.info(_privateMember);
}
}


in js then 
var child = new Child()
child.doSmthOnParent()
child.doSmthOnChild()

as you can see private variables are hapilly shared across parent and child


Thanks for comments

Dan-el Khen

unread,
Jul 6, 2015, 10:09:48 AM7/6/15
to shar...@googlegroups.com
Hi, that's correct, currently there's no added support to distinguish between different levels of private fields. You can open an issue with this on github:
https://github.com/sharpkit/sharpkit/issues

--
You received this message because you are subscribed to the Google Groups "SharpKit Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sharpkit+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages