Skip to content

Instantly share code, notes, and snippets.

@juliusfriedman
Created April 4, 2019 13:01
Show Gist options
  • Save juliusfriedman/52897453c54e23a4b0769c49cae72ba6 to your computer and use it in GitHub Desktop.
Save juliusfriedman/52897453c54e23a4b0769c49cae72ba6 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){ }
//Seems like this should also be allowed.
//public static void func(in char c){ }
//Seems like this should also be allowed..
//public static void func(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