Skip to content

Commit df7d27a

Browse files
Merge pull request #118 from ParsePlatform/richardross.unity.constructors.fix
Fix constructor detection on Unity.
2 parents 51bd147 + 4773670 commit df7d27a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Parse/Internal/ReflectionHelpers.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ internal static bool IsConstructedGenericType(this Type type) {
4747
#endif
4848
}
4949

50-
internal static IEnumerable<ConstructorInfo> GetConstructors(this Type type) {
51-
#if UNITY
52-
return type.GetConstructors();
50+
internal static IEnumerable<ConstructorInfo> GetConstructors(this Type type) {
51+
#if UNITY
52+
BindingFlags searchFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;
53+
return type.GetConstructors(searchFlags);
5354
#else
5455
return type.GetTypeInfo().DeclaredConstructors
5556
.Where(c => (c.Attributes & MethodAttributes.Static) == 0);

0 commit comments

Comments
 (0)