[Mono-bugs] [Bug 415683] New: Implicit casting allows 'as' operator in contrast with ms .net compiler

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Aug 8 04:30:53 EDT 2008


           Summary: Implicit casting allows 'as' operator in contrast with
                    ms.net compiler
           Product: Mono: Compilers
           Version: 2.0
          Platform: Other
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: avkekem at hotmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: DeveloperNet

The mono mcs compiler accepts the following implicit cast:
MyClass c = "test" as MyClass;

where MyClass contains an implicit cast from string. Mono compiles this code,
but microsoft .net compiler gives a build error. Changing the code to 
MyClass c = (MyClass)"test"; 
solves the problem on ms.net

Eventually provide a mcs flag which compiles in 'ms' mode.

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