Bug 3769 - variable should be available only after its declaration
Summary: variable should be available only after its declaration
Status: RESOLVED DUPLICATE of bug 2087
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-03-06 11:38 UTC by himajin100000
Modified: 2012-07-05 05:11 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 DUPLICATE of bug 2087

Description himajin100000 2012-03-06 11:38:43 UTC
STEP TO REPRODUCE:

1. Try to compile the following code.

REM http://ideone.com/6qpJw
 
Option Explicit On
Option Strict On
Option Compare Binary
REM Option Infer Off
 
Public Class Test1
        Public Shared Sub Main()
                a = 3           
                Dim a As Integer
                System.Console.WriteLine(a)
        End Sub
End Class

EXPECTED RESULT:
compile error should be given.

ACTUAL RESULT:
compiler successfully compiles the source.
Comment 1 himajin100000 2012-07-05 04:57:16 UTC
seems duplicate of #2087 (I noticed this when I was looking at github log)
Comment 2 Rolf Bjarne Kvinge [MSFT] 2012-07-05 05:11:16 UTC
It is, the fix for #2087 fixes this one too.

*** This bug has been marked as a duplicate of bug 2087 ***