[Mono-bugs] [Bug 358788] New: Compiler fails to compile valid C# 2.0 syntax
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Tue Feb 5 05:01:20 EST 2008
https://bugzilla.novell.com/show_bug.cgi?id=358788
Summary: Compiler fails to compile valid C# 2.0 syntax
Product: Mono: Compilers
Version: unspecified
Platform: All
OS/Version: Ubuntu
Status: NEW
Severity: Major
Priority: P5 - None
Component: C#
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: bojanr at brandeis.edu
QAContact: mono-bugs at lists.ximian.com
Found By: ---
Description of Problem:
gmcs fails to compile valid C# 2.0 syntax in 1 particular instance but will
compile it elsewhere in the same code file
Steps to reproduce the problem:
1. Grab this threading library:
http://code.google.com/p/zeroflag/downloads/list
2. Try and compile by importing into MonoDevelop and using gmcs
Actual Results:
Compiler spits out the following errors:
Building Project: zeroflag.Threading (Release|Any CPU)
Performing main compilation...
Exception caught by the compiler while compiling:
Block that caused the problem begin at:
/home/bojan/Source/MacManager/lib-zeroflag/Task.cs(405,29):
Block being compiled:
[/home/bojan/Source/MacManager/lib-zeroflag/Task.cs(406,17):,/home/bojan/Source/MacManager/lib-zeroflag/Task.cs(411,17):]
System.NullReferenceException: Object reference not set to an instance of an
object
Internal compiler error at
/home/bojan/Source/MacManager/lib-zeroflag/Task.cs(405,29):: exception caught
while emitting MethodBuilder [Task::Delay]
Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object
at Mono.CSharp.AnonymousMethodExpression.ImplicitStandardConversionExists
(System.Type delegate_type) [0x00000]
at Mono.CSharp.Convert.ImplicitStandardConversionExists
(Mono.CSharp.Expression expr, System.Type target_type) [0x00000]
at Mono.CSharp.Convert.AddConversionOperators (System.Collections.ArrayList
list, Mono.CSharp.Expression source, System.Type target_type, Boolean
look_for_explicit, Mono.CSharp.MethodGroupExpr mg) [0x00000]
at Mono.CSharp.Convert.GetConversionOperator (System.Type container_type,
Mono.CSharp.Expression source, System.Type target_type, Boolean
look_for_explicit) [0x00000]
at Mono.CSharp.Convert.UserDefinedConversion (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression source, System.Type target, Location loc, Boolean
look_for_explicit) [0x00000]
at Mono.CSharp.Convert.ImplicitUserConversion (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression source, System.Type target, Location loc) [0x00000]
at Mono.CSharp.Convert.ImplicitConversionExists (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression expr, System.Type target_type) [0x00000]
at Mono.CSharp.MethodGroupExpr.IsParamsMethodApplicable
(Mono.CSharp.EmitContext ec, System.Collections.ArrayList arguments, Int32
arg_count, System.Reflection.MethodBase candidate, Boolean do_varargs)
[0x00000]
at Mono.CSharp.MethodGroupExpr.IsParamsMethodApplicable
(Mono.CSharp.EmitContext ec, System.Collections.ArrayList arguments, Int32
arg_count, Boolean do_varargs, System.Reflection.MethodBase& candidate)
[0x00000]
at Mono.CSharp.MethodGroupExpr.IsParamsMethodApplicable
(Mono.CSharp.EmitContext ec, System.Collections.ArrayList arguments, Int32
arg_count, System.Reflection.MethodBase& candidate) [0x00000]
at Mono.CSharp.MethodGroupExpr.OverloadResolve (Mono.CSharp.EmitContext ec,
System.Collections.ArrayList Arguments, Boolean may_fail, Location loc)
[0x00000]
at Mono.CSharp.IndexerAccess.ResolveAccessor (Mono.CSharp.EmitContext ec,
AccessorType accessorType) [0x00000]
at Mono.CSharp.IndexerAccess.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.ElementAccess.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.Argument.Resolve (Mono.CSharp.EmitContext ec, Location loc)
[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.Return.DoResolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.Return.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.Block.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& unreachable) [0x00000]
Build complete -- 1 error, 0 warnings
Expected Results: Should build without any problems, it does so on Microsoft's
C# 2.0 compiler.
How often does this happen? Every time.
Additional Information: The resolution is simple:
Change the offending function:
public Task Delay(int milliseconds)
{
return this.ThenDo(new Task(this, false)[delegate()
{
System.Threading.Thread.Sleep(milliseconds);
}]);
}
to read:
public Task Delay(int milliseconds)
{
return this.ThenDo(new Task(this, false, delegate()
{
System.Threading.Thread.Sleep(milliseconds);
}));
}
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list