[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-janitors] #1475: (scrutinizer) Types for global variables are n
From: |
Chicken Trac |
Subject: |
[Chicken-janitors] #1475: (scrutinizer) Types for global variables are not refined by predicates |
Date: |
Fri, 15 Jun 2018 07:08:36 -0000 |
#1475: (scrutinizer) Types for global variables are not refined by predicates
-------------------------+-----------------------------
Reporter: megane | Owner:
Type: defect | Status: new
Priority: major | Milestone: 5.1
Component: scrutinizer | Version: 5.0
Keywords: | Estimated difficulty: easy
-------------------------+-----------------------------
{{{
(: g1 (list-of fixnum))
(define g1 '())
;; Aliased global gets refined
(let ((a g1))
(compiler-typecase a ((list-of fixnum) 1))
(if (null? a)
(compiler-typecase a (null 1))
(compiler-typecase a ((not null) 1))))
(: g2 (list-of fixnum))
(define g2 '())
(if (null? g2)
(compiler-typecase g2 (null 1)) ;; <- error
(compiler-typecase g2 ((pair fixnum (list-of fixnum)) 1)))
;; $ csc -O3 globals.scm
;;
;; Error: at toplevel:
;; (globals.scm:13) no clause applies in `compiler-typecase' for
expression of type `(list-of fixnum)':
;; null
}}}
I don't think this is an issue of non-local mutation (e.g. from other
threads). You should use mutexes or some other measures to prevent
mutation while, you're working on a global.
--
Ticket URL: <https://bugs.call-cc.org/ticket/1475>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.
- [Chicken-janitors] #1475: (scrutinizer) Types for global variables are not refined by predicates,
Chicken Trac <=