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

AttributeSet report invalid locations #1893

Open
evantypanski opened this issue Oct 16, 2024 · 0 comments · May be fixed by #1899
Open

AttributeSet report invalid locations #1893

evantypanski opened this issue Oct 16, 2024 · 0 comments · May be fixed by #1899
Assignees

Comments

@evantypanski
Copy link
Contributor

Followup from #1890

Using the AttributeSet in a diagnostic gets the following output:

 [error] <...>/invalid-type-attributes.spicy:11:17-11:16: attributes are not allow on type aliases 
 [error] <...>/invalid-type-attributes.spicy:12:15-12:14: attributes are not allow on type aliases 
 [error] <...>/invalid-type-attributes.spicy:15:28-15:27: attributes are not allow on type aliases 
 [error] <...>/invalid-type-attributes.spicy:16:20-16:19: attributes are not allow on type aliases 

Where the locations are wrong (see: 11:17-11:16). The location of the AttributeSet should encompass all of its children, I think. I'd ideally put this in addChild for the node, so any children expand a node's location, but that may have some other consequences.

@evantypanski evantypanski self-assigned this Oct 16, 2024
evantypanski added a commit that referenced this issue Oct 17, 2024
Closes #1893

When a child is added with `addChild`, the parent's location should
(generally) span over that child as well. This primarily helps for cases
where a node doesn't have much of a location until it gets children
added - like `AttributeSet`. The locations for those should encompass
all of the attributes within the set. That logic applies for any node
with a child: if it's the child, then its location should reflect that.
evantypanski added a commit that referenced this issue Oct 17, 2024
Closes #1893

When a child is added with `addChild`, the parent's location should
(generally) span over that child as well. This primarily helps for cases
where a node doesn't have much of a location until it gets children
added - like `AttributeSet`. The locations for those should encompass
all of the attributes within the set. That logic applies for any node
with a child: if it's the child, then its location should reflect that.
@evantypanski evantypanski linked a pull request Oct 17, 2024 that will close this issue
evantypanski added a commit that referenced this issue Oct 17, 2024
Closes #1893

When a child is added with `addChild`, the parent's location should
(generally) span over that child as well. This primarily helps for cases
where a node doesn't have much of a location until it gets children
added - like `AttributeSet`. The locations for those should encompass
all of the attributes within the set. That logic applies for any node
with a child: if it's the child, then its location should reflect that.
evantypanski added a commit that referenced this issue Oct 18, 2024
Closes #1893

When a child is added with `addChild`, the parent's location should
(generally) span over that child as well. This primarily helps for cases
where a node doesn't have much of a location until it gets children
added - like `AttributeSet`. The locations for those should encompass
all of the attributes within the set. That logic applies for any node
with a child: if it's the child, then its location should reflect that.
evantypanski added a commit that referenced this issue Oct 18, 2024
Closes #1893

When a child is added with `addChild`, the parent's location should
(generally) span over that child as well. This primarily helps for cases
where a node doesn't have much of a location until it gets children
added - like `AttributeSet`. The locations for those should encompass
all of the attributes within the set. That logic applies for any node
with a child: if it's the child, then its location should reflect that.
evantypanski added a commit that referenced this issue Oct 18, 2024
Closes #1893

When a child is added with `addChild`, the parent's location should
(generally) span over that child as well. This primarily helps for cases
where a node doesn't have much of a location until it gets children
added - like `AttributeSet`. The locations for those should encompass
all of the attributes within the set. That logic applies for any node
with a child: if it's the child, then its location should reflect that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant