0.9.16.43:
[sbcl.git] / tests / mop-16.impure-cload.lisp
blob86257be2077e07e33b861c3e0fac94161842c6a4
1 ;;;; miscellaneous side-effectful tests of the MOP
3 ;;;; This software is part of the SBCL system. See the README file for
4 ;;;; more information.
5 ;;;;
6 ;;;; While most of SBCL is derived from the CMU CL system, the test
7 ;;;; files (like this one) were written from scratch after the fork
8 ;;;; from CMU CL.
9 ;;;;
10 ;;;; This software is in the public domain and is provided with
11 ;;;; absolutely no warranty. See the COPYING and CREDITS files for
12 ;;;; more information.
14 ;;; this file tests that it is not possible to add an
15 ;;; optimization-invalidating method to #'(SETF
16 ;;; SLOT-VALUE-USING-CLASS). If a way is found to preserve the
17 ;;; optimization, or if the optimization is deemed to be invalid, then
18 ;;; this test can go away.
20 (defpackage "MOP-16"
21 (:use "CL" "SB-MOP"))
23 (in-package "MOP-16")
25 (defclass foo-class (standard-class) ())
27 (defclass foo-effective-slot-definition (standard-effective-slot-definition)
28 ())
30 (multiple-value-bind (value condition)
31 (ignore-errors
32 (defmethod (setf slot-value-using-class)
33 ((new-value integer) (class foo-class)
34 (object standard-object) (slotd foo-effective-slot-definition))
35 "Haha"))
36 (assert (null value))
37 (assert (typep condition 'error)))