Bug 35604 - [csharp] Bad using statements break all future REPL evaluations
Summary: [csharp] Bad using statements break all future REPL evaluations
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 4.0.0
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
: 35559 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-11-05 18:21 UTC by Sandy Armstrong [MSFT]
Modified: 2015-11-16 14:47 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 FIXED

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. ***