TYPEP source transforms can result in code opaque to constraint propagation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Low
|
Unassigned |
Bug Description
TYPEP source transforms can potentially result in expansions opaque to constraint propagation, which understands (at the moment) only %TYPEP, %INSTANCE-TYPEP, EQ, EQL, <, >, and predicates in *BACKEND-
Some arrays types used to do this, but known-bad cases were fixed in 1.0.30.51, which added new backend predicates. The general problem and brittleness remains, however: apparently benevolent changes to TYPEP source transforms can inhibit constraint propagation.
Attached patch is a sketch of source-level annotation for TYPEP forms, so that constraint propagation always has the original type to reason with. I'm not certain if this is the right way to go about this, however, or if we should just add BIG COMMENTS to srctran.lisp about needing to be careful with the type transforms and cook up tests to poke specifically at the constraint propagation of type information from transformed TYPEP calls.
%typep-wrapper seems to have dealt with that.