Opened 14 years ago
Closed 13 years ago
#207 closed defect (invalid)
DECLARE should signal conditions when type declarations are violated
| Reported by: | Mark Evenson | Owned by: | ehuelsmann |
|---|---|---|---|
| Priority: | major | Milestone: | 1.1.0 |
| Component: | interpreter | Version: | 1.1.0-dev |
| Keywords: | ansi-conformance | Cc: | |
| Parent Tickets: |
Description
On #abcl, chtune notes http://paste.lisp.org/display/129139:
defun test (x)
(let ((j 10))
(declare (integer x))
(+ x j)))
(test 10.4) ; => 20.4
; I would expect this to throw a type error
Change History (3)
comment:1 Changed 14 years ago by
comment:2 Changed 13 years ago by
| Summary: | DECLARE should signal conditions when type declaration are violated → DECLARE should signal conditions when type declarations are violated |
|---|
comment:3 Changed 13 years ago by
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
the type declaration is in the wrong place. the function should have read:
(defun test (x)
(declare (integer x))
(let ((j 10))
(+ x j)))
But that doesn't err on our side either, which is perfectly fine according to the spec, which says in Declaration TYPE:
- At the moment the scope of the declaration is entered, the consequences are undefined if the value of the declared variable is not of the declared type.
Closing as invalid.
Note: See
TracTickets for help on using
tickets.
The correct form should be:
(defun test (x) (let ((j 10)) (declare (integer x)) (+ x j)))