Bug 35604

Summary: [csharp] Bad using statements break all future REPL evaluations
Product: [Mono] Compilers Reporter: Sandy Armstrong [MSFT] <sandy>
Component: C#Assignee: Marek Safar <masafa>
Status: RESOLVED FIXED    
Severity: normal CC: matisse.hack, mono-bugs+mono
Priority: ---    
Version: 4.0.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Tags: Is this bug a regression?: ---
Last known good build:

Description Sandy Armstrong [MSFT] 2015-11-05 18:21:08 UTC
As originally reported in bug #35559

1. Start csharp REPL
2. Enter "using System.DateTime"
3. Receive error for this bad using statement
4. Enter anything else, like "1+1"

Exepcted results:

New input gets evaluated.

Actual results:

using statement error repeats itself.



This bug also impacts the C# REPL in the Inspector client.



csharp example:


[sys] ~/xam-git/inspector (stupidquotes)
$ mono --version
Mono JIT compiler version 4.2.1 (explicit/8862921 Thu Oct 29 17:09:16 EDT 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           normal
	SIGSEGV:       altstack
	Notification:  kqueue
	Architecture:  x86
	Disabled:      none
	Misc:          softdebug
	LLVM:          yes(3.6.0svn-mono-(detached/a173357)
	GC:            sgen
[sys] ~/xam-git/inspector (stupidquotes)
$ csharp
Mono C# Shell, type "help;" for help

Enter statements below.
csharp> 1+1
2
csharp> using System.DateTime;
(1,2): error CS0138: A `using' directive can only be applied to namespaces but `System.DateTime' denotes a type. Consider using a `using static' instead
/Library/Frameworks/Mono.framework/Versions/4.2.1/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous error)
csharp> 1+1
(1,2): error CS0138: A `using' directive can only be applied to namespaces but `System.DateTime' denotes a type. Consider using a `using static' instead
/Library/Frameworks/Mono.framework/Versions/4.2.1/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous error)
csharp> 1+1
(1,2): error CS0138: A `using' directive can only be applied to namespaces but `System.DateTime' denotes a type. Consider using a `using static' instead
/Library/Frameworks/Mono.framework/Versions/4.2.1/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous error)
Comment 1 Marek Safar 2015-11-10 10:39:15 UTC
Fixed in master
Comment 2 Sandy Armstrong [MSFT] 2015-11-16 14:47:26 UTC
*** Bug 35559 has been marked as a duplicate of this bug. ***