tell what a member path walked from the fields it has left
This commit is contained in:
@@ -1121,20 +1121,17 @@
|
|||||||
(let ((base (second form)))
|
(let ((base (second form)))
|
||||||
(let step ((expr (walk-operand base env))
|
(let step ((expr (walk-operand base env))
|
||||||
(type (expression-type base env))
|
(type (expression-type base env))
|
||||||
(read (list)) ; the fields walked, reversed
|
|
||||||
(fields (cddr form))
|
(fields (cddr form))
|
||||||
(told? #f))
|
(told? #f))
|
||||||
(if (null? fields)
|
(if (null? fields)
|
||||||
(copy-form-source! form expr)
|
(copy-form-source! form expr)
|
||||||
(let ((target (pointer-target type)))
|
(let ((target (pointer-target type)))
|
||||||
(unless (or type told?)
|
(unless (or type told?)
|
||||||
|
(let ((walked (drop-right (cddr form) (length fields))))
|
||||||
(sex-warning form "cannot type this; `.' reads it as a value"
|
(sex-warning form "cannot type this; `.' reads it as a value"
|
||||||
(if (null? read)
|
(if (null? walked) base `(|.| ,base ,@walked)))))
|
||||||
base
|
|
||||||
`(|.| ,base ,@(reverse read)))))
|
|
||||||
(step (list (if target '%-> 'dot-access) expr (car fields))
|
(step (list (if target '%-> 'dot-access) expr (car fields))
|
||||||
(field-type (or target type) (car fields))
|
(field-type (or target type) (car fields))
|
||||||
(cons (car fields) read)
|
|
||||||
(cdr fields)
|
(cdr fields)
|
||||||
(or told? (not type))))))))
|
(or told? (not type))))))))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user