Exemple #1
0
        public static object[] GetCustomAttributes_Property(java.lang.Class declClass,
                                                            java.lang.Class attrClass)
        {
            if (IsFSharpAttr(attrClass))
            {
                // we manufacture a CompilationMapping attribute for a property:
                // - if declared directly in a class that is an "F# type"
                //      and is not also a SumType
                // - if declared in an inner class, and the outer class
                //      is an "F# type" that is a SumType

                bool isFSharp = IsFSharpType(declClass);
                if (isFSharp)
                {
                    if (IsFSharpSumType(declClass))
                    {
                        isFSharp = false;
                    }
                }
                else
                {
                    var outerClass = declClass.getDeclaringClass();
                    if (outerClass != null)
                    {
                        isFSharp = IsFSharpType(outerClass);
                    }
                }

                if (isFSharp)
                {
                    return(CreateAttr(attrClass, /* Field */ 4));
                }

                return(RuntimeType.EmptyObjectArray);
            }
            return(null);
        }