Skip to content

Conversation

@JeffBezanson
Copy link
Member

The basic issue here was that resolve-scopes was not aware of static parameters. Typically it would mark them as outerref, but if an enclosing scope had a variable with the same name then it wouldn't. I decided that static parameters are more local, so I switched to always leaving them as bare symbols and adding them to a lambda's local environment.

@JeffBezanson JeffBezanson added compiler:lowering Syntax lowering (compiler front end, 2nd stage) bugfix This change fixes an existing bug labels Jun 24, 2018
struct Foo27710{T} end
function test27710()
types(::Foo27710{T}) where T = T
T = types(Foo27710{Int64}())
Copy link
Member

Choose a reason for hiding this comment

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

This is a pretty inscrutable test. Is assigning this particular value to T significant or is it just the fact that something is being assigned to it that's important?

Copy link
Member Author

Choose a reason for hiding this comment

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

Both. The inner function needs to work, and the assigned variable here needs to be called T.

Copy link
Member

Choose a reason for hiding this comment

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

Right, but you could do something like this instead, right:

T = nothing
types(::Foo27710{T}) where T = T
return types(Foo27710{Int64}())

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, or even better return (T, types(Foo27710{Int64}())), to make sure the assignment works too. But it seems like a pretty minor point to me.

Copy link
Member

Choose a reason for hiding this comment

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

I was just trying to understand it, not complain 😄

@JeffBezanson JeffBezanson merged commit c446444 into master Jun 25, 2018
@JeffBezanson JeffBezanson deleted the jb/fix27710 branch June 25, 2018 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix This change fixes an existing bug compiler:lowering Syntax lowering (compiler front end, 2nd stage)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants