[Mono-bugs] [Bug 412721] New: Compiler crash when lambda are used in a ternary expression

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jul 28 14:09:59 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=412721


           Summary: Compiler crash when lambda are used in a ternary
                    expression
           Product: Mono: Compilers
           Version: SVN
          Platform: i686
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: jeremie.laval at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=230320)
 --> (https://bugzilla.novell.com/attachment.cgi?id=230320)
Snippet showcasing the bug

When compiling the snippet attached compiler produce the following exception
and stacktrace :

Exception caught by the compiler while compiling:
   Block that caused the problem begin at: ternary-lambda-testcase.cs(5,28):
                     Block being compiled:
[ternary-lambda-testcase.cs(8,17):,ternary-lambda-testcase.cs(8,98):]
System.InvalidCastException: Cannot cast from source type to destination type.
Internal compiler error at ternary-lambda-testcase.cs(5,28):: exception caught
while emitting MethodBuilder [TestCase::Main]

Unhandled Exception: System.InvalidCastException: Cannot cast from source type
to destination type.
  at Mono.CSharp.Convert.ImplicitConversionStandard (Mono.CSharp.EmitContext
ec, Mono.CSharp.Expression expr, System.Type target_type, Location loc, Boolean
explicit_cast) [0x00214] in /home/jeremie/mono/mono/mcs/mcs/convert.cs:1416 
  at Mono.CSharp.Convert.ImplicitConversionStandard (Mono.CSharp.EmitContext
ec, Mono.CSharp.Expression expr, System.Type target_type, Location loc)
[0x00000] in /home/jeremie/mono/mono/mcs/mcs/convert.cs:1306 
  at Mono.CSharp.Convert.ImplicitConversion (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression expr, System.Type target_type, Location loc) [0x00011]
in /home/jeremie/mono/mono/mcs/mcs/convert.cs:1281 
  at Mono.CSharp.Convert.ImplicitConversionRequired (Mono.CSharp.EmitContext
ec, Mono.CSharp.Expression source, System.Type target_type, Location loc)
[0x00000] in /home/jeremie/mono/mono/mcs/mcs/convert.cs:1433 
  at Mono.CSharp.Assign.ResolveConversions (Mono.CSharp.EmitContext ec)
[0x00000] in /home/jeremie/mono/mono/mcs/mcs/assign.cs:363 
  at Mono.CSharp.Assign.DoResolve (Mono.CSharp.EmitContext ec) [0x00176] in
/home/jeremie/mono/mono/mcs/mcs/assign.cs:352 
  at Mono.CSharp.SimpleAssign.DoResolve (Mono.CSharp.EmitContext ec) [0x00000]
in /home/jeremie/mono/mono/mcs/mcs/assign.cs:418 
  at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags
flags) [0x00067] in /home/jeremie/mono/mono/mcs/mcs/ecore.cs:468 
  at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000] in
/home/jeremie/mono/mono/mcs/mcs/ecore.cs:495 
  at Mono.CSharp.ExpressionStatement.ResolveStatement (Mono.CSharp.EmitContext
ec) [0x00000] in /home/jeremie/mono/mono/mcs/mcs/ecore.cs:1299 
  at Mono.CSharp.StatementExpression.Resolve (Mono.CSharp.EmitContext ec)
[0x0000b] in /home/jeremie/mono/mono/mcs/mcs/statement.cs:743 
  at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x000f0] in
/home/jeremie/mono/mono/mcs/mcs/statement.cs:2254 
  at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x000f0] in
/home/jeremie/mono/mono/mcs/mcs/statement.cs:2254 
  at Mono.CSharp.ExplicitBlock.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
in /home/jeremie/mono/mono/mcs/mcs/statement.cs:2557 
  at Mono.CSharp.EmitContext.ResolveTopBlock (Mono.CSharp.EmitContext
anonymous_method_host, Mono.CSharp.ToplevelBlock block, Mono.CSharp.Parameters
ip, IMethodData md, System.Boolean& unreachable) [0x00087] in
/home/jeremie/mono/mono/mcs/mcs/codegen.cs:784


-- 
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