Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inner function signature using sparams #17487

Merged
merged 3 commits into from
Jul 21, 2016
Merged

inner function signature using sparams #17487

merged 3 commits into from
Jul 21, 2016

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented Jul 18, 2016

allows an inner function signature to reference sparams of the caller

fix #15068

# return (subf(one(T), x * im), subf(unsigned(one(T))))
#end
#@test local_innersig(Int32(2)) == ((Int32(2), Int32(1), Int32(2)im), (Int32(2), UInt32(1)))
#@test local_innersig(Int64(3)) == ((Int64(3), Int64(1), Int64(3)im), (Int64(3), UInt64(1)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use test_broken then?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the function definition lowering comes out wrong, not the test

@garborg garborg modified the milestone: 0.5.0 Jul 19, 2016
@garborg
Copy link
Contributor

garborg commented Jul 19, 2016

Re: added and removed milestone -- ignore, was unintentional.

@vtjnash
Copy link
Member Author

vtjnash commented Jul 20, 2016

@JeffBezanson review thoughts?

`(thunk
(define (type-for-closure-parameterized name P names fields types super)
(let ((n (length P)))
`((thunk
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should return a list; needing a list of the expression is only an artifact of how this is used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also doesn't need to return a lambda, just a couple of statements, but lowering handled that wrong

@JeffBezanson
Copy link
Member

A few minor comments, but looks basically good.

vtjnash added 3 commits July 20, 2016 23:45
there is logic present to also handle all locals,
but this causes some broken toplevel lowering to fail
(notably, some gensym locals are getting pulled into global scope
and some toplevel scopes are incorrectly identified as local scope)

fix #15068
@JeffBezanson
Copy link
Member

Interesting crash on 32-bit travis here.

@tkelman
Copy link
Contributor

tkelman commented Jul 21, 2016

helped by #17516 probably?

@yuyichao
Copy link
Contributor

Should be

@vtjnash vtjnash merged commit c8f0d05 into master Jul 21, 2016
@vtjnash vtjnash deleted the jn/inner-sig-sp branch July 21, 2016 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inner function signatures cannot depend on static parameters
5 participants