is ModuleDefinition.Import on nullable bool correct?

1 view
Skip to first unread message

Dirk Bonné

unread,
Oct 20, 2009, 8:48:57 AM10/20/09
to mono-cecil
Hi

I noticed a problem when trying importing a nullable bool:

[Test]
public void ImportNullable()
{
var assDef = AssemblyFactory.DefineAssembly("test", "test",
TargetRuntime.NET_2_0, AssemblyKind.Dll);
var tr = assDef.MainModule.Import(typeof(bool?));
Assert.IsTrue(tr.IsValueType);
}

I would expect IsValueType to return true for "bool?".

Is this a bug?

I fell over that when generating properties/fields with nullable
types, and it may be the cause of a type loader exception.

Any ideas to get around this?

regards
Dirk



Dirk Bonné

unread,
Oct 20, 2009, 9:12:52 AM10/20/09
to mono-cecil
Ok forget it, I just tried the SVN version and there it works. Sorry to
bother you all :(

regards,
Dirk
Reply all
Reply to author
Forward
0 new messages