#207: DECLARE should signal conditions when type declaration are violated ------------------------------+--------------------------------------------- Reporter: mevenson | Owner: ehuelsmann Type: defect | Status: new Priority: major | Milestone: 1.1.0 Component: interpreter | Version: 1.1.0-dev Keywords: ansi-conformance | ------------------------------+--------------------------------------------- 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 }}}
#207: DECLARE should signal conditions when type declaration are violated ------------------------------+--------------------------------------------- Reporter: mevenson | Owner: ehuelsmann Type: defect | Status: new Priority: major | Milestone: 1.1.0 Component: interpreter | Version: 1.1.0-dev Keywords: ansi-conformance | ------------------------------+---------------------------------------------
Comment(by mevenson):
The correct form should be:
{{{ (defun test (x) (let ((j 10)) (declare (integer x)) (+ x j))) }}}
#207: DECLARE should signal conditions when type declarations are violated ------------------------------+--------------------------------------------- Reporter: mevenson | Owner: ehuelsmann Type: defect | Status: new Priority: major | Milestone: 1.1.0 Component: interpreter | Version: 1.1.0-dev Keywords: ansi-conformance | ------------------------------+---------------------------------------------
#207: DECLARE should signal conditions when type declarations are violated --------------------------+------------------------------------------------- Reporter: mevenson | Owner: ehuelsmann Type: defect | Status: closed Priority: major | Milestone: 1.1.0 Component: interpreter | Version: 1.1.0-dev Resolution: invalid | Keywords: ansi-conformance --------------------------+------------------------------------------------- Changes (by ehuelsmann):
* status: new => closed * resolution: => invalid
Comment:
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 [http://www.lispworks.com/documentation/HyperSpec/Body/d_type.htm Declaration TYPE]:
3. 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.
armedbear-ticket@common-lisp.net