[nem-en] howto: "isBaseField"

Dmitry Ivankov divanorama at gmail.com
Wed Apr 25 21:05:21 CEST 2007


What is correct way to determine whether a class field belong to base class?
(in Typer3)

Following seems to work

IsBaseField (f : IField) : bool {
  CurrentType.parent_type != null &&
  CurrentType.parent_type.tycon.GetMembers (). Exists (
    x => x.MemberKind == MemberKinds.Field && (x :> IField) : object == f
  )
}

But it looks into all parents and all their members, looking only
into class own fields can be more efficient.
Is there a way to get only class own members?
And is it a right way to compare IFields as objects?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /mailman/pipermail/devel-en/attachments/20070425/cf46b5b3/attachment.html


More information about the devel-en mailing list