internal static TypeSymbol TransformType(TypeSymbol type, ImmutableArray <bool> transformFlags) { var decoder = new NativeIntegerTypeDecoder(transformFlags); try { var result = decoder.TransformType(type); if (decoder._index == transformFlags.Length) { return(result); } else { return(new UnsupportedMetadataTypeSymbol()); } } catch (UnsupportedSignatureContent) { return(new UnsupportedMetadataTypeSymbol()); } catch (ErrorTypeException) { // If we failed to decode because there was an error type involved, marking the // metadata as unsupported means that we'll cover up the error that would otherwise // be reported for the type. This would likely lead to a worse error message as we // would just report a BindToBogus, so return the type unchanged. Debug.Assert(type.ContainsErrorType()); return(type); } }