Skip to content

Instantly share code, notes, and snippets.

@juliusfriedman
Created April 4, 2019 12:57
Show Gist options
  • Save juliusfriedman/c3de0e9b408add44652e10eee8c959bb to your computer and use it in GitHub Desktop.
Save juliusfriedman/c3de0e9b408add44652e10eee8c959bb to your computer and use it in GitHub Desktop.
using System;
public class C {
//Supported
public static void func(char c){ }
//Supported
public static void func(ref char c){ }
//Seems like this should also be allowed
//public static void func(ref readonly char c){ }
//Supported
public static void funcS<T>(in T t) where T : struct{ }
//Supported
public static void funcSR<T>(ref T t) where T : class{ }
//Supported
public static void funcC<T>(in T t) where T : class{ }
//Supported
public static void funcCR<T>(ref T t) where T : class{ }
}
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
public class C
{
public static void func(char c)
{
}
public static void func(ref char c)
{
}
public static void funcS<T>([In] [IsReadOnly] ref T t) where T : struct
{
}
public static void funcSR<T>(ref T t) where T : class
{
}
public static void funcC<T>([In] [IsReadOnly] ref T t) where T : class
{
}
public static void funcCR<T>(ref T t) where T : class
{
}
}
{
"version": 1,
"target": "C#",
"mode": "Debug"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment