Replies: 2 comments 5 replies
-
This was my original concern. In worst case, a library author will blindly or incorrectly make their method requiring caller unsafe, delivering unintended break to their users. This would have a cascade effect in the whole ecosystem. |
Beta Was this translation helpful? Give feedback.
-
|
The idea of even considering the complete change of Re: new syntax. Aside from attribute and new keyword, one can also consider reusing // `unsafe` after return type means the caller should be unsafe,
// or read it as Foo is unsafe.
// My best preferred, if `unsafe` were to be reused with a different placement.
public static void unsafe Foo() { }
// This is weird.
public static void Foo unsafe () { }
// This is somewhat C++-ish (cf. final/override in C++).
public static void Foo() unsafe { }For accessor methods, But I feel playing with placement is confusing, and I think using a well-known attribute is the better approach. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
https://github.com/dotnet/csharplang/blob/main/meetings/2026/LDM-2026-01-21.md#unsafe-evolution
Agenda
Beta Was this translation helpful? Give feedback.
All reactions