csharplang
csharplang copied to clipboard
Champion "Binary Literals" and "Digit Separators" (C# 7.0)
- [x] Proposal added (binary literals, digit separators)
- [x] Discussed in LDM (2016-10-18)
- [x] Decision in LDM
- [x] Finalized (done, rejected, inactive)
- [ ] Spec'ed
See also
- https://github.com/dotnet/roslyn/issues/215
- https://github.com/dotnet/roslyn/issues/216
This is a "proposal issue" because we need to add a proposal/spec to the repo.
Is there any particular reason why digit separators are allowed in integer digits, but not in fraction digits? For example:
> 1_2; // "Works" (weirdly), 122
> 1_2.34; // "Works" (wierdly), 122.34
> 122.3_4; // Fails, (1,6): error CS1525: Unexpected symbol `_4'
System Information (running Mono on Fedora 30):
$ mono --version
Mono JIT compiler version 6.8.0.96 (tarball Wed Jan 15 09:00:57 UTC 2020)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: yes(610)
Suspend: hybrid
GC: sgen (concurrent by default)
Command To Start Interpreter:
csharp -langversion:Experimental
Is there any particular reason why digit separators are allowed in integer digits, but not in fraction digits?
It is allowed.
Fails, (1,6): error CS1525: Unexpected symbol `_4' System Information (running Mono on Fedora 30):
Sounds like a mono problem. Maybe report this to them?
Specification in progress at https://github.com/dotnet/csharpstandard/pull/548.