|
1321 | 1321 | (define (remove-argument-side-effects e)
|
1322 | 1322 | (let ((a '()))
|
1323 | 1323 | (cond
|
1324 |
| - ((and (decl? e) (symbol? (cadr e))) |
1325 |
| - (cons (cadr e) (list e))) |
1326 | 1324 | ((not (pair? e))
|
1327 | 1325 | (cons e '()))
|
1328 | 1326 | (else
|
1329 | 1327 | (cons (map (lambda (x)
|
1330 | 1328 | (cond
|
1331 |
| - ((and (decl? x) (symbol? (cadr x))) |
1332 |
| - (set! a (cons x a)) |
1333 |
| - (cadr x)) |
1334 | 1329 | ((not (effect-free? x))
|
1335 | 1330 | (let ((g (make-ssavalue)))
|
1336 | 1331 | (if (or (eq? (car x) '...) (eq? (car x) '&))
|
|
1943 | 1938 |
|
1944 | 1939 | '|::|
|
1945 | 1940 | (lambda (e)
|
1946 |
| - (if (length= e 2) |
| 1941 | + (if (not (length= e 3)) |
1947 | 1942 | (error "invalid \"::\" syntax"))
|
1948 |
| - (if (and (length= e 3) (not (symbol-like? (cadr e)))) |
| 1943 | + (if (not (symbol-like? (cadr e))) |
1949 | 1944 | `(call (core typeassert)
|
1950 | 1945 | ,(expand-forms (cadr e)) ,(expand-forms (caddr e)))
|
1951 | 1946 | (map expand-forms e)))
|
@@ -2915,10 +2910,13 @@ f(x) = yt(x)
|
2915 | 2910 | ;; remaining `decl` expressions are only type assertions if the
|
2916 | 2911 | ;; argument is global or a non-symbol.
|
2917 | 2912 | ((decl)
|
2918 |
| - (if (or (assq (cadr e) (car (lam:vinfo lam))) |
2919 |
| - (assq (cadr e) (cadr (lam:vinfo lam)))) |
2920 |
| - '(null) |
2921 |
| - (cl-convert `(call (core typeassert) ,@(cdr e)) fname lam namemap toplevel interp))) |
| 2913 | + (cond ((not (symbol? (cadr e))) |
| 2914 | + (cl-convert `(call (core typeassert) ,@(cdr e)) fname lam namemap toplevel interp)) |
| 2915 | + ((or (assq (cadr e) (car (lam:vinfo lam))) |
| 2916 | + (assq (cadr e) (cadr (lam:vinfo lam)))) |
| 2917 | + '(null)) |
| 2918 | + (else (syntax-deprecation #f (string "global " (deparse `(|::| ,@(cdr e)))) "typeassert") |
| 2919 | + (cl-convert `(call (core typeassert) ,@(cdr e)) fname lam namemap toplevel interp)))) |
2922 | 2920 | ;; `with-static-parameters` expressions can be removed now; used only by analyze-vars
|
2923 | 2921 | ((with-static-parameters)
|
2924 | 2922 | (cl-convert (cadr e) fname lam namemap toplevel interp))
|
|
0 commit comments