It would be great if we could reference code snippets in unit tests that are known to work and compile.
Having sample code that doesn't actually compile is a very common - and avoidable - problem.
Case in point: The code found here: https://developer.apple.com/documentation/authenticationservices/public-private_key_authentication/supporting_passkeys doesn't actually compile because the API has changed.
let platformProvider = ASAuthorizationPlatformPublicKeyCredentialProvider(relyingPartyIdentifier: "example.com")
...should be...
let platformProvider = ASAuthorizationPlatformPublicKeyCredentialProvider("example.com")
Other platforms such as .NET's SandCastle Help File Builder support this capability, btw.