[Mono-bugs] [Bug 377028] New: Code throws exception but should (probably) report an error

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Apr 3 20:14:28 EDT 2008


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


           Summary: Code throws exception but should (probably) report an
                    error
           Product: Mono: Compilers
           Version: 1.9.0
          Platform: PowerPC
        OS/Version: Mac OS X 10.4
            Status: NEW
          Severity: Minor
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: johannes at jroith.de
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


class A
{
        private string test;

        public A ()
        {
                this.test bad = null;
        }

}

The (of course broken) code above will throw this exception:

Unhandled Exception: Mono.CSharp.InternalErrorException: test.cs(5,16): A.A()
---> System.Exception: Expression Mono.CSharp.LocalVariableReference
(bad:test.cs(7,22):) did not set its type after Resolve
  at Mono.CSharp.Expression.ResolveLValue (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression right_side, Location loc) [0x00000] 
  at Mono.CSharp.Assign.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.EmitContext.ResolveTopBlock (Mono.CSharp.EmitContext
anonymous_method_host, Mono.CSharp.ToplevelBlock block, Mono.CSharp.Parameters
ip, IMethodData md, System.Boolean& unreachable) [0x00000] --- End of inner
exception stack trace ---

  at Mono.CSharp.TypeContainer.EmitConstructors () [0x00000] 
  at Mono.CSharp.TypeContainer.EmitType () [0x00000] 
  at Mono.CSharp.RootContext.EmitCode () [0x00000] 
  at Mono.CSharp.Driver.MainDriver (System.String[] args) [0x00000] 
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] 



It should, however, probably simply report an error.


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