Click or drag to resize

ReadOnlySpanTCastUpTDerived Method

CastUp is not supported on this shim: unmanaged types cannot satisfy 'where TDerived : class, T'.

Not supported on .NET Framework.

CastUp<TDerived> exists for reference-type covariance (e.g. ReadOnlySpan<string>ReadOnlySpan<object>), which is incompatible with the where T : unmanaged constraint required by this shim. Unmanaged types are never reference types and therefore covariant casting is meaningless in this context.


Namespace: System
Assembly: C2JBridge (in C2JBridge.dll) Version: 2.6.9.260611-9a148513a79c26cdd7f1dde468f4f9e06ef3bc7e
Syntax
[ObsoleteAttribute("CastUp is not supported on this shim: unmanaged types cannot satisfy 'where TDerived : class, T'.", 
	true)]
public static ReadOnlySpan<T> CastUp<TDerived>(
	ReadOnlySpan<TDerived> items
)
where TDerived : struct, new()

Parameters

items  ReadOnlySpanTDerived
The source span to cast from.

Type Parameters

TDerived
The derived type to cast from. Must satisfy where TDerived : class, T, which is incompatible with the unmanaged constraint of this shim.

Return Value

ReadOnlySpanT
Never returns — always throws NotSupportedException.
See Also