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 step ((expr (walk-operand base env))
|
||||
(type (expression-type base env))
|
||||
(read (list)) ; the fields walked, reversed
|
||||
(fields (cddr form))
|
||||
(told? #f))
|
||||
(if (null? fields)
|
||||
(copy-form-source! form expr)
|
||||
(let ((target (pointer-target type)))
|
||||
(unless (or type told?)
|
||||
(sex-warning form "cannot type this; `.' reads it as a value"
|
||||
(if (null? read)
|
||||
base
|
||||
`(|.| ,base ,@(reverse read)))))
|
||||
(let ((walked (drop-right (cddr form) (length fields))))
|
||||
(sex-warning form "cannot type this; `.' reads it as a value"
|
||||
(if (null? walked) base `(|.| ,base ,@walked)))))
|
||||
(step (list (if target '%-> 'dot-access) expr (car fields))
|
||||
(field-type (or target type) (car fields))
|
||||
(cons (car fields) read)
|
||||
(cdr fields)
|
||||
(or told? (not type))))))))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user