Skip to content

Instantly share code, notes, and snippets.

@eiriktsarpalis
Last active August 29, 2015 14:08
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 eiriktsarpalis/197499e416227f7f91ff to your computer and use it in GitHub Desktop.
Save eiriktsarpalis/197499e416227f7f91ff to your computer and use it in GitHub Desktop.
namespace Repro
{
[CompilationMapping(SourceConstructFlags.ObjectType)]
[Serializable]
public class Foo<T>
{
internal T value;
public T Value
{
get
{
return this.value;
}
}
public Foo(Bar bar, T value) : this()
{
this.value = value;
}
}
[CompilationMapping(SourceConstructFlags.ObjectType)]
[Serializable]
public class Bar
{
internal FSharpRef<Bar> self = new FSharpRef<Bar>(null);
internal int init@6;
public Bar() : this()
{
this.self.contents = this;
this.init@6 = 1;
}
public Foo<T> Create<T>(T x)
{
if (this.init@6 < 1)
{
LanguagePrimitives.IntrinsicFunctions.FailInit();
}
return this.create<T>(x);
}
[CompilerGenerated]
internal Foo<T> create<T>(T x)
{
PrintfFormat<FSharpFunc<Type, Unit>, TextWriter, Unit, Unit> format = new PrintfFormat<FSharpFunc<Type, Unit>, TextWriter, Unit, Unit, Type>("%O");
PrintfModule.PrintFormatLineToTextWriter<FSharpFunc<Type, Unit>>(Console.Out, format).Invoke(typeof(object));
return new Foo<object>(LanguagePrimitives.IntrinsicFunctions.CheckThis<Bar>(this.self.contents), x);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment