Skip to content

Instantly share code, notes, and snippets.

@svick
Last active June 6, 2019 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svick/f72b644625dbdbbe6b05e2d8d36710e7 to your computer and use it in GitHub Desktop.
Save svick/f72b644625dbdbbe6b05e2d8d36710e7 to your computer and use it in GitHub Desktop.
using System;
using System.Reflection;
using System.Reflection.Emit;
class Program
{
static void Main()
{
var assembly = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("a.dll"), AssemblyBuilderAccess.Run);
var module = assembly.DefineDynamicModule("a.dll");
var type = module.DefineType("S", default, typeof(ValueType));
var field = type.DefineField("s", typeof(Span<int>), default);
type.CreateType();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment