[Mono-bugs] [Bug 704799] New: Compiler doesn't seem to be able to find types after they are imported following an error

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Jul 9 22:45:31 EDT 2011


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

https://bugzilla.novell.com/show_bug.cgi?id=704799#c0


           Summary: Compiler doesn't seem to be able to find types after
                    they are imported following an error
    Classification: Mono
           Product: Mono: Compilers
           Version: 1.2.0
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: michael.miller at suse.com
        ReportedBy: gshackles at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML,
like Gecko) Chrome/13.0.782.41 Safari/535.1

Using csharp.exe (or Mono.CSharp on its own), it seems like after the compiler
has an error that a certain type is not found, it is still unable to find it
even if the namespace is then imported. For example:

csharp> var sb = new StringBuilder();
{interactive}(1,15): error CS0246: The type or namespace name `StringBuilder'
could not be found. Are you missing a using directive or an assembly reference?
{interactive}(1,2): error CS0825: The contextual keyword `var' may only appear
within a local variable declaration
csharp> using System.Text;
csharp> var sb = new StringBuilder();
{interactive}(1,15): error CS0246: The type or namespace name `StringBuilder'
could not be found. Are you missing a using directive or an assembly reference?
{interactive}(1,2): error CS0825: The contextual keyword `var' may only appear
within a local variable declaration

However, (in a new session) if the namespace is brought in first, everything
works as expected:

csharp> using System.Text;
csharp> var sb = new StringBuilder();

Reproducible: Always

Steps to Reproduce:
1. Start csharp.exe
2. eval: var sb = new StringBuilder();
3. eval: using System.Text;
4. eval: var sb = new StringBuilder();
Actual Results:  
Compiler still can't find the type

Expected Results:  
Compiler should now be able to find the type

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list