diff --git a/ICSharpCode.Decompiler.Tests/DisassemblerPrettyTestRunner.cs b/ICSharpCode.Decompiler.Tests/DisassemblerPrettyTestRunner.cs
index 9fa9e7e85..c4a6a0492 100644
--- a/ICSharpCode.Decompiler.Tests/DisassemblerPrettyTestRunner.cs
+++ b/ICSharpCode.Decompiler.Tests/DisassemblerPrettyTestRunner.cs
@@ -52,6 +52,12 @@ namespace ICSharpCode.Decompiler.Tests
}
}
+ [Test]
+ public async Task GenericConstraints()
+ {
+ await Run();
+ }
+
[Test]
public async Task SecurityDeclarations()
{
diff --git a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
index 2c3e9f93f..6f1bbc9dc 100644
--- a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
+++ b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
@@ -91,6 +91,7 @@
+
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Disassembler/Pretty/GenericConstraints.il b/ICSharpCode.Decompiler.Tests/TestCases/Disassembler/Pretty/GenericConstraints.il
new file mode 100644
index 000000000..e6283ef08
--- /dev/null
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Disassembler/Pretty/GenericConstraints.il
@@ -0,0 +1,45 @@
+.assembly extern mscorlib
+{
+ .publickeytoken = (
+ b7 7a 5c 56 19 34 e0 89
+ )
+ .ver 4:0:0:0
+}
+.assembly GenericConstraints
+{
+ .custom instance void [mscorlib]System.Reflection.AssemblyFileVersionAttribute::.ctor(string) = (
+ 01 00 07 31 2e 30 2e 30 2e 30 00 00
+ )
+ .hash algorithm 0x00008004 // SHA1
+ .ver 1:0:0:0
+}
+
+.module GenericConstraints.dll
+.imagebase 0x10000000
+.file alignment 0x00000200
+.stackreserve 0x00100000
+.subsystem 0x0003 // WindowsCui
+.corflags 0x00000001 // ILOnly
+
+.class private auto ansi ''
+{
+} // end of class
+
+.class public auto ansi beforefieldinit TestType`1
+ extends [mscorlib]System.Object
+{
+ // Methods
+ .method public hidebysig specialname rtspecialname
+ instance void .ctor () cil managed
+ {
+ // Method begins at RVA 0x2050
+ // Header size: 1
+ // Code size: 7 (0x7)
+ .maxstack 8
+
+ IL_0000: ldarg.0
+ IL_0001: call instance void [mscorlib]System.Object::.ctor()
+ IL_0006: ret
+ } // end of method TestType::.ctor
+
+} // end of class TestType
diff --git a/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs b/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs
index 4836276e2..76affb1ca 100644
--- a/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs
+++ b/ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs
@@ -1733,6 +1733,11 @@ namespace ICSharpCode.Decompiler.Disassembler
{
output.Write("valuetype ");
}
+ const GenericParameterAttributes allowByRefLike = (GenericParameterAttributes)0x0020;
+ if ((gp.Attributes & allowByRefLike) == allowByRefLike)
+ {
+ output.Write("byreflike ");
+ }
if ((gp.Attributes & GenericParameterAttributes.DefaultConstructorConstraint) == GenericParameterAttributes.DefaultConstructorConstraint)
{
output.Write(".ctor ");