mail-archives/mono-bugs/2010-October/105267.html

223 строки
5.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-bugs] [Bug 648616] New: Nested generic type field type is emitted incorrectly
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20648616%5D%20New%3A%20Nested%20generic%20type%20field%20type%20is%0A%20emitted%20incorrectly&In-Reply-To=">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="105266.html">
<LINK REL="Next" HREF="105295.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-bugs] [Bug 648616] New: Nested generic type field type is emitted incorrectly</H1>
<B>bugzilla_noreply at novell.com</B>
<A HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20648616%5D%20New%3A%20Nested%20generic%20type%20field%20type%20is%0A%20emitted%20incorrectly&In-Reply-To="
TITLE="[Mono-bugs] [Bug 648616] New: Nested generic type field type is emitted incorrectly">bugzilla_noreply at novell.com
</A><BR>
<I>Fri Oct 22 08:49:30 EDT 2010</I>
<P><UL>
<LI>Previous message: <A HREF="105266.html">[Mono-bugs] [Bug 648599] New: Installation dialog shows error even if adding repository has been cancelled
</A></li>
<LI>Next message: <A HREF="105295.html">[Mono-bugs] [Bug 648616] Nested generic type field type is emitted incorrectly
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#105267">[ date ]</a>
<a href="thread.html#105267">[ thread ]</a>
<a href="subject.html#105267">[ subject ]</a>
<a href="author.html#105267">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>
<A HREF="https://bugzilla.novell.com/show_bug.cgi?id=648616">https://bugzilla.novell.com/show_bug.cgi?id=648616</A>
<A HREF="https://bugzilla.novell.com/show_bug.cgi?id=648616#c0">https://bugzilla.novell.com/show_bug.cgi?id=648616#c0</A>
Summary: Nested generic type field type is emitted incorrectly
Classification: Mono
Product: Mono: Runtime
Version: SVN
Platform: Other
OS/Version: Other
Status: NEW
Severity: Major
Priority: P5 - None
Component: misc
AssignedTo: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">rkumpera at novell.com</A>
ReportedBy: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">msafar at novell.com</A>
QAContact: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at lists.ximian.com</A>
Found By: ---
Blocker: ---
Compile &amp; run
using System;
using System.Reflection;
using System.Reflection.Emit;
class Program
{
static void Main ()
{
AssemblyName asmname = new AssemblyName ();
asmname.Name = &quot;sre&quot;;
AssemblyBuilder asmbuild = System.Threading.Thread.GetDomain ().
DefineDynamicAssembly (asmname,
AssemblyBuilderAccess.RunAndSave);
ModuleBuilder modbuild = asmbuild.DefineDynamicModule (&quot;modulename&quot;,
&quot;sre.exe&quot;);
TypeBuilder myType = modbuild.DefineType (&quot;Sample&quot;,
TypeAttributes.Public);
string[] typeParamNames = { &quot;TFirst&quot; };
myType.DefineGenericParameters (typeParamNames);
var nested = myType.DefineNestedType (&quot;nested&quot;);
nested.DefineGenericParameters (typeParamNames);
var field = myType.DefineField (&quot;field&quot;, nested,
FieldAttributes.Public);
var m = myType.DefineMethod (&quot;test&quot;, MethodAttributes.Public);
m.SetParameters (myType);
var ilgen = m.GetILGenerator ();
ilgen.Emit (OpCodes.Ldarg_0);
ilgen.Emit (OpCodes.Ldfld, field);
ilgen.Emit (OpCodes.Pop);
ilgen.Emit (OpCodes.Ret);
var baked = myType.CreateType ();
nested.CreateType ();
asmbuild.Save (&quot;sre.exe&quot;);
return;
}
}
Disassembly produced sre.exe
Mono emits invalid
IL_0001: ldfld class Sample/'nested' class Sample&lt;!TFirst&gt;::'field'
NET
IL_0001: ldfld class Sample/'nested'&lt;!0&gt; class Sample&lt;!TFirst&gt;::'field'
--
Configure bugmail: <A HREF="https://bugzilla.novell.com/userprefs.cgi?tab=email">https://bugzilla.novell.com/userprefs.cgi?tab=email</A>
------- You are receiving this mail because: -------
You are the QA contact for the bug.
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="105266.html">[Mono-bugs] [Bug 648599] New: Installation dialog shows error even if adding repository has been cancelled
</A></li>
<LI>Next message: <A HREF="105295.html">[Mono-bugs] [Bug 648616] Nested generic type field type is emitted incorrectly
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#105267">[ date ]</a>
<a href="thread.html#105267">[ thread ]</a>
<a href="subject.html#105267">[ subject ]</a>
<a href="author.html#105267">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/mono-bugs">More information about the mono-bugs
mailing list</a><br>
</body></html>