Bug 3653 - defining conversion operator to its derived type should generate BC33027
Summary: defining conversion operator to its derived type should generate BC33027
Status: RESOLVED UPSTREAM
Alias: None
Product: Compilers
Classification: Mono
Component: VisualBasic ()
Version: unspecified
Hardware: PC Windows
: Low minor
Target Milestone: ---
Assignee: Rolf Bjarne Kvinge [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2012-02-27 02:46 UTC by himajin100000
Modified: 2018-05-22 12:07 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED UPSTREAM

Description himajin100000 2012-02-27 02:46:24 UTC
STEPS TO REPRODUCE:

1. Try to compile the following code.

REM http://ideone.com/ncHAg
 
Public Class Class1
 
        Public Shared Narrowing Operator CType(ByVal value As Class1) As Class2
                Dim result As New Class2
                Return result
        End Operator
 
End Class
 
Public Class Class2 : Inherits Class1
End Class
 
Public Class FooBar
        Public Shared Sub Main()
        End Sub
End Class


EXPECTED RESULT:

compiler should fail to compile the source, giving BC33027 as MS Implementation does.

ACTUAL RESULT:

compiler successfully compiled the source.
Comment 1 Rolf Bjarne Kvinge [MSFT] 2018-05-22 12:07:10 UTC
Moved to: https://github.com/mono/mono-basic/issues/27