swift
59adfcd0 - Sema: Detect conflicting subtype bindings imposed on closure type variables

Commit
34 days ago
Sema: Detect conflicting subtype bindings imposed on closure type variables A type variable that represents the type of a closure can only be bound to a function type, but this fact is not directly encoded in the constraint system. Check for the appearance of a non-sensical subtype binding on a closure type variable in reduceBinding(), and promote the binding to exact as soon as we detect this, since binding the type will always fail; we want to fail as quickly as possible, before attempting any more disjunctions. This is a generally good performance optimization, and it also addresses a performance regression from "Sema: Filter bindings by considering conformance constraints". This also speeds up the expression from rdar://59008707, which also uses Combine and is slow for similar reasons.
Author
Committer
Parents
Loading