MCPcopy Create free account
hub / github.com/apache/fory / CanDeclareElementType

Method CanDeclareElementType

csharp/src/Fory/CollectionSerializers.cs:41–59  ·  view source on GitHub ↗
(TypeInfo typeInfo, WriteContext context)

Source from the content-addressed store, hash-verified

39 }
40
41 private static bool CanDeclareElementType<T>(TypeInfo typeInfo, WriteContext context)
42 {
43 if (typeInfo.IsBuiltinType)
44 {
45 return true;
46 }
47
48 if (NeedsCompatibleElementTypeMeta(typeInfo, context))
49 {
50 return false;
51 }
52
53 if (!TypeResolver.NeedToWriteTypeInfoForField(typeInfo))
54 {
55 return true;
56 }
57
58 return typeof(T).IsSealed;
59 }
60
61 private static bool CanDeclareRuntimeElementType<T>(
62 List<T> list,

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected