You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
produce a warning instead of an error for pointer to managed type in unsafe context
consider System.TypedReference to be managed
As a result, it is possible to emit reference to this type in new contexts. For example in a pointer type.
The natural way to do it in Microsoft.Cci.MetadataWriter.SerializeTypeReference would be to call a SignatureTypeEncoder.TypedReference() method, but that method doesn't exist.
Note that such an API exists on ReturnTypeEncoder, LocalVariableTypeEncoder, and ParameterTypeEncoder already.
privatevoidSerializeTypeReference(SignatureTypeEncoderencoder,ITypeReferencetypeReference){while(true){if(module.IsPlatformType(typeReference,PlatformType.SystemTypedReference)){encoder.TypedReference();return;}... handle other types and recursive scenarios}
Alternative Designs
It is possible to call Builder.WriteByte((byte)SignatureTypeCode.TypedReference); directly. That's the workaround used by the compiler for now.
Activity
steveharter commentedon Jan 26, 2023
Also exists on
FieldTypeEncodertoday.bartonjs commentedon Mar 23, 2023
Video
Looks good as proposed.