[Mono-bugs] [Bug 475342] New: using 'super' instead of 'base' to call base constructor crashes compiler

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Feb 12 14:44:12 EST 2009


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


           Summary: using 'super' instead of 'base' to call base
                    constructor crashes compiler
    Classification: Mono
           Product: Mono: Compilers
           Version: SVN
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: ijbema at fmf.nl
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.6)
Gecko/2009020911 Ubuntu/8.04 (hardy) Firefox/3.0.6

When you use super instead of base the compiler crashes (both mcs and gmcs).
Semi-minimal example:

public class Foo {
    public Foo(int a){}
}

public class ChildFoo:Foo {
    public ChildFoo(int a):super(a){}
}

Minimal example:

class Bar {Bar(int a):super(a){}}

Reproducible: Always

Steps to Reproduce:
Compile this program:

class Bar {Bar(int a):super(a){}}
Actual Results:  
System.InvalidCastException: Cannot cast from source type to destination type.
  at Mono.CSharp.CSharpParser.yyparse (yyInput yyLex) [0x00000] 
  at Mono.CSharp.CSharpParser.parse () [0x00000] 


Expected Results:  
Give a sensible 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