117 lines
3.2 KiB
Markdown
117 lines
3.2 KiB
Markdown
# C# Language Design Notes for Jul 5, 2017
|
|
|
|
## Agenda
|
|
|
|
Triage of features in the C# 7.2 milestone. They don't all fit: which should be dropped, which should be kept, and which should be pushed out?
|
|
|
|
1. Static delegates *(8.0)*
|
|
2. Native int and IntPtr operators *(7.X)*
|
|
3. Field target *(anytime)*
|
|
4. Utf8 strings *(8.0)*
|
|
5. Slicing *(7.X)*
|
|
6. Blittable *(7.2)*
|
|
7. Ref structs *(7.2)*
|
|
8. Ref readonly *(7.2)*
|
|
9. Conditional ref *(7.2)*
|
|
10. Ref extensions on structs *(7.2)*
|
|
11. Readonly locals and params *(X.X)*
|
|
12. ref structs in tuples *(don't)*
|
|
13. Overload resolution tie breakers with long tuples *(use underlying generics)*
|
|
|
|
|
|
# Static delegates
|
|
Won't have time, and should probably be in a major release.
|
|
|
|
## Conclusion
|
|
8.0 for now.
|
|
|
|
|
|
# Native int and IntPtr operators
|
|
This won't make 7.2.
|
|
|
|
## Conclusion
|
|
Let's try to keep in 7 wave as 7.X (in case we have more point releases) . Probably only one of these will become a feature, but keeping both for now until we decide.
|
|
|
|
|
|
# Field target
|
|
Bug fix, do this anytime.
|
|
|
|
## Conclusion
|
|
Make sure it is on the Roslyn backlog.
|
|
|
|
|
|
# Utf8 strings
|
|
There's a bigger story that needs to be worked out here. There needs to be decisions around interpolated strings, formattable strings etc. This feels low on the list, and we don't have enough data to design it yet.
|
|
|
|
## Conclusion
|
|
Next major release: 8.0.
|
|
|
|
|
|
# Slicing
|
|
We would want to add a `Range` type, a syntax `3..5` to create a `Range` and then people can write indexers over ranges to implement slicing.
|
|
|
|
We could make it an entirely target-typed thing, where something with a proper constructor could be initialized with a span. Lots to think about.
|
|
|
|
Either way, `Span<T>` APIs would eventually want to make use of this, but would not depend on it from the outset.
|
|
|
|
## Conclusion
|
|
This won't make 7.2 but keeping it 7.X to keep thinking about it.
|
|
|
|
|
|
# Blittable
|
|
Small language feature, useful for certain scenarios but not central to 7.2 value proposition.
|
|
|
|
## Conclusion
|
|
Let's do it if we get to it. Keep it 7.2, but low pri for that release.
|
|
|
|
|
|
# Ref structs
|
|
Essential to the scenario and also almost done.
|
|
|
|
Still need `stackalloc` rules worked out. We'd prefer to keep that part of the functionality in, but could delay it if necessary.
|
|
|
|
## Conclusion
|
|
Stay in 7.2.
|
|
|
|
|
|
# Ref readonly
|
|
Essential to the scenario and pretty much done.
|
|
|
|
## Conclusion
|
|
Keep in 7.2.
|
|
|
|
|
|
# Conditional ref
|
|
Not essential but already done.
|
|
|
|
## Conclusion
|
|
Keep in 7.2.
|
|
|
|
|
|
# Ref extensions on structs
|
|
Not essential but already done.
|
|
|
|
## Conclusion
|
|
Keep in 7.2.
|
|
|
|
|
|
# Readonly locals and params
|
|
Stands on its own. It has some commonality with 7.2 scenarios, but is not essentially tied. Could be done together with ref readonly locals later. Also it has a lot of design work still to be done.
|
|
|
|
## Conclusion
|
|
Push to X.X.
|
|
|
|
|
|
# ref structs in tuples
|
|
Tuples can't contain ref structs because those can't be type arguments.
|
|
|
|
## Conclusion
|
|
That's a big pandora's box to open, and we won't.
|
|
|
|
|
|
# Overload resolution tie breakers with long tuples
|
|
There's an esoteric difference between whether "specificity" tie breaker should special case long tuple as a flat list, or should work according to the underlying generics, which are nested.
|
|
|
|
## Conclusion
|
|
We stick with how it works now, which is the underlying generics.
|
|
|