Outward function type hint propagation

Description

New feature: Detect the type of a function and arrange so that it is available for outward type hinting.

For reference, a small amount of discussion from Jan 2016 in the #cljs-dev Slack:

mfikes: Curious if "outward" ^boolean propagation has been debated / rejected. Example: If simple analysis detects that ^boolean can be applied as in for functions like (defn f [x] (not x)). Perhaps automatically propagating type hints in this direction would be unwelcome by users?

dnolen: @mfikes: we have already have outward propagation for numerics which broke because of changes for code motion

dnolen: absolutely nothing against that

Environment

None

Attachments

3
  • 04 Jul 2018, 02:49 PM
  • 02 Jul 2018, 06:23 PM
  • 04 Apr 2017, 01:38 AM

Activity

Show:

Mike Fikes July 4, 2018 at 2:49 PM

CLJS-1997-3.patch rebaselines and while accommodating AST changes

Mike Fikes July 2, 2018 at 6:23 PM

CLJS-1997-2.patch rebaselines

Mike Fikes June 16, 2017 at 4:30 PM

I've been soaking this for a couple of months (with local builds of Planck), and haven't seen anything break, FWIW. So, I think it is at least a safe change. Assigning to David for further consideration.

David Nolen April 7, 2017 at 5:15 PM

Thanks will think about it

Completed

Details

Assignee

Reporter

Approval

Accepted

Patch

Code

Priority

Created April 4, 2017 at 1:20 AM
Updated July 4, 2018 at 4:58 PM
Resolved July 4, 2018 at 4:58 PM