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)

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


Attachments

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

Notice (2018-05-21): bugzilla.xamarin.com will be switching to read-only mode on Thursday, 2018-05-25 22:00 UTC.

Please join us on Visual Studio Developer Community and GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs and copy them to the new locations as needed for follow-up. The See Also field on each Bugzilla bug will be updated with a link to its new location when applicable.

After Bugzilla is read-only, if you have new information to add for a bug that does not yet have a matching issue on Developer Community or GitHub, you can create a follow-up issue in the new location. Copy and paste the title and description from this bug, and then add your new details. You can get a pre-formatted version of the title and description here:

In special cases you might also want the comments:

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.

Note You need to log in before you can comment on or make changes to this bug.