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

Fix custom pragma not working for ref object and ptr object #10107

Closed
wants to merge 1 commit into from
Closed

Fix custom pragma not working for ref object and ptr object #10107

wants to merge 1 commit into from

Conversation

nc-x
Copy link
Contributor

@nc-x nc-x commented Dec 28, 2018

Closes #8457

@@ -1153,8 +1153,8 @@ proc typeSectionFinalPass(c: PContext, n: PNode) =
var x = a[2]
while x.kind in {nkStmtList, nkStmtListExpr} and x.len > 0:
x = x.lastSon
if x.kind notin {nkObjectTy, nkDistinctTy, nkEnumTy, nkEmpty} and
Copy link
Member

Choose a reason for hiding this comment

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

This was carefully constructed to only cover the "nominal" types, ptr and ref are structural types.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay there might be a better fix then, but currently ptr and ref are kind of evaluated twice - for eg. #10125 (comment)

@nc-x nc-x closed this Jan 2, 2019
@nc-x nc-x deleted the fix-custom-pragmas branch January 2, 2019 09:43
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.

2 participants