From 66f80abce84078323c49e7b767c75dba2b9122a8 Mon Sep 17 00:00:00 2001 From: Julien Couvreur Date: Tue, 15 Oct 2024 15:47:15 -0700 Subject: [PATCH] Clarify the compiler's policy towards well-known types/members --- docs/compilers/CSharp/Deviations from Standard.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/compilers/CSharp/Deviations from Standard.md b/docs/compilers/CSharp/Deviations from Standard.md index b7f6077d32e77..66cee1e3a9ca5 100644 --- a/docs/compilers/CSharp/Deviations from Standard.md +++ b/docs/compilers/CSharp/Deviations from Standard.md @@ -70,3 +70,10 @@ interface I1 { void M() { } } interface I2 { int M => 0; } interface I : I1, I2 { } ``` + +# Assumptions about well-known types/members + +The compiler is free to make assumptions about the shape and behavior of well-known types/members. +It may not check for unexpected constraints, `Obsolete` attribute, or `UnmanagedCallersOnly` attribute. +It may perform some optimizations based on expectations that the types/members are well-behaved. +Note: the compiler should remain resilient to missing well-known types/members.