Freeing D users from the burden of writing redundant attributes that the compiler can infer would be a fantastic enhancement imo.

For public functions I was thinking of a way to make inference safer: generating a .di file with the inferred attributes and auto substituted by the return type, and then make the compiler check the inferred attributes against the previous ones and trigger an error if there was an API breakage, forcing the programmer to acknowledge it by removing the function from the .di file, or by fixing the function to match its previous signature. Would this make inference safe enough for public functions?

Reply via email to