Opened 9 years ago

Closed 9 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 9 years ago by Mark Evenson

The correct form should be:

(defun test (x)
  (let ((j 10))
    (declare (integer x))
    (+ x j)))

comment:2 Changed 9 years ago by Mark Evenson

Summary: DECLARE should signal conditions when type declaration are violatedDECLARE should signal conditions when type declarations are violated

comment:3 Changed 9 years ago by ehuelsmann

Resolution: invalid
Status: newclosed

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:

  1. 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.