Esempio n. 1
0
        internal static TypeWithAnnotations TransformType(
            TypeWithAnnotations metadataType,
            byte defaultTransformFlag,
            ImmutableArray <byte> nullableTransformFlags
            )
        {
            if (nullableTransformFlags.IsDefault && defaultTransformFlag == 0)
            {
                return(metadataType);
            }

            int position = 0;
            TypeWithAnnotations result;

            if (
                metadataType.ApplyNullableTransforms(
                    defaultTransformFlag,
                    nullableTransformFlags,
                    ref position,
                    out result
                    ) && (nullableTransformFlags.IsDefault || position == nullableTransformFlags.Length)
                )
            {
                return(result);
            }

            // No NullableAttribute applied to the target symbol, or flags do not line-up, return unchanged metadataType.
            return(metadataType);
        }