Skip to content
This repository has been archived by the owner on Oct 27, 2023. It is now read-only.

Commit

Permalink
Allow cattrs on generic param constraints, recent roslyn versions see…
Browse files Browse the repository at this point in the history
…ms to generate them.
  • Loading branch information
vargaz committed Aug 29, 2019
1 parent f9c1e2f commit caa8e7f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion reflect/CustomAttributeData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ private static CustomAttributeTypedArgument ReadFixedArg(Module context, ByteRea
}
else
{
throw new InvalidOperationException();
throw new InvalidOperationException(type.ToString());
}
}

Expand Down
2 changes: 2 additions & 0 deletions reflect/Metadata/Tables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1244,6 +1244,8 @@ internal static int EncodeHasCustomAttribute(int token)
return (token & 0xFFFFFF) << 5 | 18;
case GenericParamTable.Index:
return (token & 0xFFFFFF) << 5 | 19;
case GenericParamConstraintTable.Index:
return (token & 0xFFFFFF) << 5 | 20;
default:
throw new InvalidOperationException();
}
Expand Down
2 changes: 2 additions & 0 deletions reflect/Reader/MetadataReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ internal int ReadHasCustomAttribute()
return (ManifestResourceTable.Index << 24) + (codedIndex >> 5);
case 19:
return (GenericParamTable.Index << 24) + (codedIndex >> 5);
case 20:
return (GenericParamConstraintTable.Index << 24) + (codedIndex >> 5);
default:
throw new BadImageFormatException();
}
Expand Down

0 comments on commit caa8e7f

Please sign in to comment.