Add LDM Notes for February 24th, 2021.
This commit is contained in:
parent
8b3d79f62b
commit
1a7ae36a02
55
meetings/2021/LDM-2021-02-24.md
Normal file
55
meetings/2021/LDM-2021-02-24.md
Normal file
|
@ -0,0 +1,55 @@
|
|||
# C# Language Design Meeting for Feb 24th, 2021
|
||||
|
||||
## Agenda
|
||||
|
||||
1. [Static abstract members in interfaces](#static-abstract-members-in-interfaces)
|
||||
|
||||
## Quote of the Day
|
||||
|
||||
- "I'm not using the monoid word, I'm trying to make it relatable"
|
||||
|
||||
## Discussion
|
||||
|
||||
### Static abstract members in interfaces
|
||||
|
||||
https://github.com/dotnet/csharplang/issues/4436
|
||||
|
||||
Today we went over the proposed specification for `static` abstract members. In order to scope the initial implementation, this proposal
|
||||
intentionally limits such members to _only_ `abstract` members, not `virtual` members. This is due to complexity in passing along the
|
||||
"instance" that the static is operating on. Consider this example:
|
||||
|
||||
```cs
|
||||
interface I
|
||||
{
|
||||
virtual static void I1() { I2(); }
|
||||
abstract static I2();
|
||||
}
|
||||
|
||||
class C : I
|
||||
{
|
||||
public static void I2() {}
|
||||
}
|
||||
|
||||
C.I1();
|
||||
// How does the runtime pass along the information that the type here is C,
|
||||
// and I.M1() should invoke C.I2()?
|
||||
```
|
||||
|
||||
Given the complexity of implementation of this scenario and the lack of current motivating examples, we will push this out for a later
|
||||
version unless our investigations of representing generic math end up needing it.
|
||||
|
||||
#### `==` and `!=` operators
|
||||
|
||||
These are restricted in interfaces today because interface types cannot implement `object.Equals(object other)` and `object.GetHashcode()`,
|
||||
which are integral to implementing the operators correctly. We can lift that restriction for `abstract static` members, as the implementing
|
||||
concrete type will then be required to provide implementations of `Equals(object other)` and `GetHashcode()`.
|
||||
|
||||
#### `sealed` on non-abstract members
|
||||
|
||||
We don't have any strong feelings on allowing `sealed` on non-virtual `static` interface members. It's fine to include in the proposal.
|
||||
|
||||
#### Conversion restrictions
|
||||
|
||||
As we implement a set of math interfaces, we'll come across parts of the current restrictions that make it impossible. We should be cautious
|
||||
here and only lift restrictions as much as is necessary to implement the target scenarios. We can review the rules in depth when they have
|
||||
been proven out by final usage.
|
|
@ -39,14 +39,16 @@
|
|||
- async method builder override (Stephen/Julien): https://github.com/dotnet/csharplang/blob/master/proposals/async-method-builders.md
|
||||
- interpolated string improvements (Fred): https://github.com/333fred/csharplang/blob/improved-interpolated-strings/proposals/improved-interpolated-strings.md
|
||||
|
||||
## Feb 24, 2021
|
||||
|
||||
- Static virtual members (Mads): https://github.com/dotnet/csharplang/issues/4436
|
||||
|
||||
# C# Language Design Notes for 2021
|
||||
|
||||
Overview of meetings and agendas for 2021
|
||||
|
||||
## Feb 24, 2021
|
||||
|
||||
[C# Language Design Notes for February 24th, 2021](https://github.com/dotnet/csharplang/blob/master/meetings/2021/LDM-2021-02-24.md)
|
||||
|
||||
1. Static abstract members in interfaces
|
||||
|
||||
## Feb 22, 2021
|
||||
|
||||
[C# Language Design Notes for February 22nd, 2021](https://github.com/dotnet/csharplang/blob/master/meetings/2021/LDM-2021-02-22.md)
|
||||
|
|
Loading…
Reference in a new issue