mail-archives/mono-bugs/2009-March/086969.html

255 строки
8.7 KiB
HTML
Исходник Постоянная ссылка Обычный вид История

2019-06-06 22:03:35 +03:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-bugs] [Bug 484868] New: Internal compiler error on generic class with # of gen. type args &gt; 1 and a mix of non-generic and a generic method overloads.
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20484868%5D%20New%3A%20Internal%20compiler%20error%20on%20generic%0A%20class%20with%20%23%20of%20gen.%20type%20args%20%3E%201%20and%20a%20mix%20of%20non-generic%20and%20a%20generic%0A%20method%20overloads.&In-Reply-To=">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="086967.html">
<LINK REL="Next" HREF="087166.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-bugs] [Bug 484868] New: Internal compiler error on generic class with # of gen. type args &gt; 1 and a mix of non-generic and a generic method overloads.</H1>
<B>bugzilla_noreply at novell.com</B>
<A HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20484868%5D%20New%3A%20Internal%20compiler%20error%20on%20generic%0A%20class%20with%20%23%20of%20gen.%20type%20args%20%3E%201%20and%20a%20mix%20of%20non-generic%20and%20a%20generic%0A%20method%20overloads.&In-Reply-To="
TITLE="[Mono-bugs] [Bug 484868] New: Internal compiler error on generic class with # of gen. type args &gt; 1 and a mix of non-generic and a generic method overloads.">bugzilla_noreply at novell.com
</A><BR>
<I>Thu Mar 12 13:38:09 EDT 2009</I>
<P><UL>
<LI>Previous message: <A HREF="086967.html">[Mono-bugs] [Bug 484773] WorkingDictionary outside of the project file breaks the build
</A></li>
<LI>Next message: <A HREF="087166.html">[Mono-bugs] [Bug 484868] Internal compiler error on generic class with # of gen. type args &gt; 1 and a mix of non-generic and a generic method overloads.
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#86969">[ date ]</a>
<a href="thread.html#86969">[ thread ]</a>
<a href="subject.html#86969">[ subject ]</a>
<a href="author.html#86969">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE><A HREF="https://bugzilla.novell.com/show_bug.cgi?id=484868">https://bugzilla.novell.com/show_bug.cgi?id=484868</A>
Summary: Internal compiler error on generic class with # of
gen. type args &gt; 1 and a mix of non-generic and a
generic method overloads.
Classification: Mono
Product: Mono: Compilers
Version: 2.2.x
Platform: x86-64
OS/Version: openSUSE 11.1
Status: NEW
Severity: Critical
Priority: P5 - None
Component: C#
AssignedTo: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at lists.ximian.com</A>
ReportedBy: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">aboyko41 at yahoo.com</A>
QAContact: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at lists.ximian.com</A>
Found By: ---
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.4)
Gecko/2008103100 SUSE/3.0.4-4.7 Firefox/3.0.4
here is a sample code:
using System;
namespace CompilerErrorRepro
{
// note: it appears the class has to have at least 2 generic type params to
fail.
public class MyClass&lt;T1, T2&gt;
{
// this {1.1} method decl is where the internal compiler error occurs.
// note: same error if {1.1} is removed and {1.2} uncommented:
// {1.1}
public T1 DoSomething(T2 data)
{
DoSomething(() =&gt; data);
return default(T1);
}
// {1.2}
// public void DoSomething(T2 data)
// {
// DoSomething(() =&gt; data);
// }
// note: comment out either of the following two overloads
// to prevent the internal compiler error
// {2}
public void DoSomething(Func&lt;T2&gt; valueExpression)
{
}
//note: no internal compiler error with this:
// public void DoSomething(Func&lt;T1, T2&gt; valueExpression)
// but there is an error with the following:
// {3}
public void DoSomething&lt;TMethodSpecific&gt;(Func&lt;TMethodSpecific, T2&gt;
valueExpression)
{
}
}
}
<A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">login at linux-zald</A>:~/Projects/BupRepro/BupRepro&gt; gmcs -target:library MyClass.cs
Exception caught by the compiler while compiling:
Block that caused the problem begin at: MyClass.cs(12,27):
Block being compiled:
[MyClass.cs(13,17):,MyClass.cs(16,17):]
System.ArgumentOutOfRangeException: Index is less than 0 or more than or equal
to the list count.
Parameter name: index
1
Internal compiler error at MyClass.cs(12,27):: exception caught while emitting
MethodBuilder [MyClass`2::DoSomething]
Unhandled Exception: System.ArgumentOutOfRangeException: Index is less than 0
or more than or equal to the list count.
Parameter name: index
1
at System.Collections.ArrayList.ThrowNewArgumentOutOfRangeException
(System.String name, System.Object actual, System.String message) [0x00000]
at System.Collections.ArrayList.set_Item (Int32 index, System.Object value)
[0x00000]
at Mono.CSharp.TypeInferenceContext.RemoveDependentTypes
(System.Collections.ArrayList types, System.Type returnType) [0x00000]
at Mono.CSharp.TypeInferenceContext.FixIndependentTypeArguments
(System.Type[] methodParameters, System.Boolean&amp; fixed_any) [0x00000]
at Mono.CSharp.TypeInferenceV3.InferInPhases (Mono.CSharp.EmitContext ec,
Mono.CSharp.TypeInferenceContext tic, Mono.CSharp.AParametersCollection
methodParameters) [0x00000]
at Mono.CSharp.TypeInferenceV3.InferMethodArguments (Mono.CSharp.EmitContext
ec, System.Reflection.MethodBase method) [0x00000]
at Mono.CSharp.TypeManager.InferTypeArguments (Mono.CSharp.EmitContext ec,
System.Collections.ArrayList arguments, System.Reflection.MethodBase&amp; method)
[0x00000]
at Mono.CSharp.MethodGroupExpr.IsApplicable (Mono.CSharp.EmitContext ec,
System.Collections.ArrayList arguments, Int32 arg_count,
System.Reflection.MethodBase&amp; method, System.Boolean&amp; params_expanded_form)
[0x00000]
at Mono.CSharp.MethodGroupExpr.OverloadResolve (Mono.CSharp.EmitContext ec,
System.Collections.ArrayList&amp; Arguments, Boolean may_fail, Location loc)
[0x00000]
at Mono.CSharp.Invocation.DoResolveOverload (Mono.CSharp.EmitContext ec)
[0x00000]
at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags
flags) [0x00000]
at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.ExpressionStatement.ResolveStatement (Mono.CSharp.EmitContext
ec) [0x00000]
at Mono.CSharp.StatementExpression.Resolve (Mono.CSharp.EmitContext ec)
[0x00000]
at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.ExplicitBlock.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.EmitContext.ResolveTopBlock (Mono.CSharp.EmitContext
anonymous_method_host, Mono.CSharp.ToplevelBlock block, Mono.CSharp.Parameters
ip, IMethodData md, System.Boolean&amp; unreachable) [0x00000]
Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Actual Results:
Internal compiler erros
Expected Results:
Should compile.
--
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.
You are the assignee for the bug.
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="086967.html">[Mono-bugs] [Bug 484773] WorkingDictionary outside of the project file breaks the build
</A></li>
<LI>Next message: <A HREF="087166.html">[Mono-bugs] [Bug 484868] Internal compiler error on generic class with # of gen. type args &gt; 1 and a mix of non-generic and a generic method overloads.
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#86969">[ date ]</a>
<a href="thread.html#86969">[ thread ]</a>
<a href="subject.html#86969">[ subject ]</a>
<a href="author.html#86969">[ 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>