swift
73506717 - [Sema] Catch use-before-declarations in nested closures

Commit
28 days ago
[Sema] Catch use-before-declarations in nested closures Previously we would allow these in Sema and diagnose them in SILGen, but allowing them in Sema is unsound because it means the constraint system ends up kicking interface type requests for declarations that should be type-checked as part of the closure itself. Adjust the name lookup logic to look through parent closures when detecting invalid forward references. For now we don't fallback to an outer result on encountering a use-before-declaration to preserve the current behavior. I'm planning on changing that in the next commit though. rdar://74430478
Author
Committer
Parents
Loading