<div dir="ltr">Hi,<div><br></div><div>I&#39;m using Swift to do some language feature research. One feature I&#39;m testing is automatic identifying implicit conformations if a nominal type implicitly satisfies a protocol&#39;s requirement. Then I can use that type as the protocol directly.</div><div><br></div><div>The way I&#39;m doing is in the second AST visiting pass of the TypeChecker. When visiting a nominal type node, </div><div>- Finding all visible protocols in this context</div><div>- For each protocol, add a synthesized conformance, and use the conformance checker to check</div><div>- If fail, remove the synthesized conformance</div><div><br></div><div>Just wondering the proper way to get all visible protocols in a decl context? Right now, I record all the protocols during the type checker&#39;s first AST visit pass. Seems not good. Any suggestions to this and to the above conformance checking? </div><div><br></div><div>Many thanks! </div></div>