|
|
@ -1,4 +1,4 @@ |
|
|
|
// Copyright (c) 2018 Daniel Grunwald
|
|
|
|
// Copyright (c) 2018 Daniel Grunwald
|
|
|
|
//
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
|
|
|
// software and associated documentation files (the "Software"), to deal in the Software
|
|
|
@ -40,8 +40,7 @@ namespace ICSharpCode.Decompiler.TypeSystem |
|
|
|
SRM.MetadataReader metadata, |
|
|
|
TypeSystemOptions options, |
|
|
|
Nullability nullableContext, |
|
|
|
bool typeChildrenOnly = false, |
|
|
|
bool isSignatureReturnType = false) |
|
|
|
bool typeChildrenOnly = false) |
|
|
|
{ |
|
|
|
bool hasDynamicAttribute = false; |
|
|
|
bool[] dynamicAttributeData = null; |
|
|
@ -134,14 +133,6 @@ namespace ICSharpCode.Decompiler.TypeSystem |
|
|
|
options, tupleElementNames, |
|
|
|
nullability, nullableAttributeData |
|
|
|
); |
|
|
|
if (isSignatureReturnType && hasDynamicAttribute |
|
|
|
&& inputType.SkipModifiers().Kind == TypeKind.ByReference |
|
|
|
&& attributes.Value.HasKnownAttribute(metadata, KnownAttribute.IsReadOnly)) |
|
|
|
{ |
|
|
|
// crazy special case: `ref readonly` return takes one dynamic index more than
|
|
|
|
// a non-readonly `ref` return.
|
|
|
|
visitor.dynamicTypeIndex++; |
|
|
|
} |
|
|
|
if (typeChildrenOnly) |
|
|
|
{ |
|
|
|
return inputType.VisitChildren(visitor); |
|
|
@ -190,6 +181,7 @@ namespace ICSharpCode.Decompiler.TypeSystem |
|
|
|
|
|
|
|
public override IType VisitModOpt(ModifiedType type) |
|
|
|
{ |
|
|
|
dynamicTypeIndex++; |
|
|
|
if ((options & TypeSystemOptions.KeepModifiers) != 0) |
|
|
|
return base.VisitModOpt(type); |
|
|
|
else |
|
|
@ -198,6 +190,7 @@ namespace ICSharpCode.Decompiler.TypeSystem |
|
|
|
|
|
|
|
public override IType VisitModReq(ModifiedType type) |
|
|
|
{ |
|
|
|
dynamicTypeIndex++; |
|
|
|
if ((options & TypeSystemOptions.KeepModifiers) != 0) |
|
|
|
return base.VisitModReq(type); |
|
|
|
else |
|
|
|