First Draft: Static Single Assignment
jmh530
john.michael.hall at gmail.com
Tue Nov 18 18:05:47 UTC 2025
On Tuesday, 18 November 2025 at 17:55:19 UTC, jmh530 wrote:
> On Tuesday, 18 November 2025 at 17:05:56 UTC, Tim wrote:
>> On Tuesday, 18 November 2025 at 13:31:00 UTC, Quirin Schroll
>> wrote:
>>> [...]
>>
>> For full C++ interop it would also be needed for the hidden
>> `this` parameter of methods, but `final` on methods already
>> means something different:
>> ```
>> extern(C++) class C
>> {
>> void f() final; // Does final mean head const here?
>> }
>> ```
>>
>> The syntax could distinguish between `final` before and after
>> the declaration, but that could be confusing. It would be
>> better to use a different keyword for head const with C++
>> compatibility.
>
> Good point.
Similarly, assuming this DIP is approved as-is, a newcomer to the
language might be a little confused by the snippet below.
```
class C {
final int f() {}
}
```
Is the function returning a `final int` or is it a `final` method?
More information about the dip.development
mailing list