Skip to content

Commit

Permalink
Revert "deprecation warning for old parametric method syntax. fixes J…
Browse files Browse the repository at this point in the history
…uliaLang#11310 (JuliaLang#22834)"

This partially reverts commit c6e51d0.
  • Loading branch information
yuyichao committed Oct 26, 2017
1 parent 476ba94 commit 45e9b71
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -838,9 +838,12 @@
(sig (car temp))
(params (cdr temp)))
(if (pair? params)
(syntax-deprecation #f
(string "inner constructor " name "(...)" (linenode-string (function-body-lineno body)))
(deparse `(where (call (curly ,name ,@params) ...) ,@params))))
(let* ((lnos (filter (lambda (e) (and (pair? e) (eq? (car e) 'line)))
body))
(lno (if (null? lnos) '() (car lnos))))
(syntax-deprecation #f
(string "inner constructor " name "(...)" (linenode-string lno))
(deparse `(where (call (curly ,name ,@params) ...) ,@params)))))
`(function ,sig ,(ctor-body body params)))))))

(define (function-body-lineno body)
Expand Down Expand Up @@ -1117,16 +1120,6 @@
(eq? (caar argl) 'parameters))))))
(name (if (or (decl? name) (and (pair? name) (eq? (car name) 'curly)))
#f name)))
(if has-sp
(syntax-deprecation #f
(string "parametric method syntax " (deparse (cadr e))
(linenode-string (function-body-lineno body)))
(deparse `(where (call ,(or name
(cadr (cadr (cadr e))))
,@(if (has-parameters? argl)
(cons (car argl) (cddr argl))
(cdr argl)))
,@raw-typevars))))
(expand-forms
(method-def-expr name sparams argl body rett))))
(else
Expand Down

0 comments on commit 45e9b71

Please sign in to comment.