Summary
-picky shouldn't warn when other path also returns an undefined value?
Metadata
- Id: eb1395c1d3b8818fa0919b6fcb2bd3abaacdc588
- Trac id: 459
- Type: defect
- Reporter: alanpost
- Owner:
- Cc: alanpost@sunflowerriver.org
- Status: closed
- Component: compiler
- Estimated difficulty:
- Resolution: fixed
- Priority: minor
- Milestone: 4.9.0
- Version: 4.6.x
- Changetime: 2012-09-24 21:47:48 UTC
- Created: 2010-12-16 23:34:09 UTC
- Keywords:
Description
I'm not sure this issue can be fixed, but here it goes:
The following code:
(define (foo) (if condition (for-each (lambda x x) '(0 1 2))))
when compiled with '-picky', gives the following warning:
Warning: in toplevel procedure `foo': conditional in tail-position has branch with undefined result: (if condition (let (... ...) (let ... ...)) (##core#undefined))
However, the other branch *also* returns an undefined result, making this particular warning a no-op in this case.
I would expect to not see this error when both branches return the same result.
Is this condition detectable?
Changes and comments
[2010-12-16 23:49:24 UTC] alanpost set cc to alanpost@sunflowerriver.org
[2010-12-18 13:11:36 UTC] felix changed status from new to closed
[2010-12-18 13:11:36 UTC] felix set resolution to fixed
[2010-12-18 13:11:36 UTC] felix wrote:
-picky has been removed. This can not be solved without interprocedural flow analysis.
[2011-06-01 09:00:41 UTC] felix changed milestone from 4.7.0 to 4.8.0
[2011-06-01 09:00:41 UTC] felix wrote:
Milestone 4.7.0 deleted
[2012-09-24 21:47:48 UTC] felix changed milestone from 4.8.0 to 4.9.0
[2012-09-24 21:47:48 UTC] felix wrote:
Milestone 4.8.0 deleted