SE-0335: Introduce existential `any`

Users (and library authors) do not like unfixable warnings that can not be silenced. A warning implies that something should be fixed. In our particular case, it is unfixable in the current state of the language and proposal. Libraries don't like warnings because they are a reputation hazard: no user likes to embed third-party code and see warnings everywhere.

I was interested in recent discussions about lifting constraints about conditional compilation (as discussed, for example, in SE-0330: Conditionals in Collections). I mean that if the code below 1. compiles, and 2. recognizes doc comments as such, I would be satisfied:

/// Doc comment (written once)
#if compiler(>=5.6)
public def foo(_ x: any P)
#else
public def foo(_ x: P)
#endif
{
  // function body (written once)
}

I understand that this would be a big Xmas gift.

4 Likes