Changeset 15604 for trunk/abcl/src


Ignore:
Timestamp:
11/28/22 10:28:16 (4 months ago)
Author:
Mark Evenson
Message:

Made calling superclass constructors in jnew-runtime-class work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/runtime-class.lisp

    r14903 r15604  
    2020   lists of constructor, method and field definitions.
    2121
    22    Constructor definitions - currently NOT supported - are lists of the form
     22   Constructor definitions are lists of the form
    2323   (argument-types function &optional super-invocation-arguments)
    2424   where argument-types is a list of strings and function is a lisp function of
     
    103103          (emit 'return)))
    104104      (dolist (constructor constructors)
    105         (destructuring-bind (argument-types function
    106                              &key (modifiers '(:public)))
     105        (destructuring-bind (argument-types function &optional super-args)
    107106            constructor
    108107          (let* ((argument-types (mapcar #'java::canonicalize-java-type argument-types))
    109108                 (argc (length argument-types))
    110                  (ctor (make-jvm-method :constructor :void argument-types :flags modifiers))
     109                 (ctor (make-jvm-method :constructor :void argument-types))
    111110                 (field-name (string (gensym "CONSTRUCTOR")))
    112111                 (all-argc (1+ argc)))
     
    120119
    121120              (aload 0)
    122               (emit-invokespecial-init (class-file-superclass class-file) nil)
     121              (dolist (arg super-args)
     122                (aload arg))
     123              (emit-invokespecial-init
     124               (class-file-superclass class-file)
     125               (map 'list
     126                    (lambda (index) (elt argument-types (1- index)))
     127                    super-args))
     128                                           
    123129
    124130              (aload 0)
Note: See TracChangeset for help on using the changeset viewer.