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

Issue 15094 - __traits(getMember) fails when the source is a struct/class field #5215

Closed
wants to merge 1 commit into from

Conversation

9rnsr
Copy link
Contributor

@9rnsr 9rnsr commented Oct 21, 2015

https://issues.dlang.org/show_bug.cgi?id=15094

If TemplateInstance.semanticTiargs is called from TraitsExp, do not strip off the contexts of argument expressions:

  1. give true to the intypeid parameter of Type.resolve call.
  2. leave TOKdotvar and TOKdottd as-is.

@@ -87,6 +88,19 @@ extern (C++) static void collectUnitTests(Dsymbols* symbols, AA* uniqueUnitTests
}
}

// strip off expression context
Copy link
Member

Choose a reason for hiding this comment

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

Some more explanation of what this function does and why is needed.

@dlang-bot
Copy link
Contributor

Fix Bugzilla Description
15094 __traits(getMember) fails when the source is a struct/class field

// It might really be an Expression or an Alias
ta.resolve(loc, sc, &ea, &ta, &sa);
ta.resolve(loc, sc, &ea, &ta, &sa, (flags & 1) != 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have a named flag for this instead of 1?

@9rnsr
Copy link
Contributor Author

9rnsr commented May 18, 2016

Added ddtailed comments, and fixed auto-tester failure.

JohanEngelen added a commit to weka/ldc that referenced this pull request May 31, 2016
I did not apply all formatting/stylistic changes.
…ct/class field

If `TemplateInstance.semanticTiargs` is called from `TraitsExp`,
do not strip off the contexts of argument expressions:

1. give `true` to the `intypeid` parameter of `Type.resolve` call.
2. leave `TOKdotvar` and `TOKdottd` as-is.
EyalIO pushed a commit to weka/ldc that referenced this pull request Jun 23, 2016
I did not apply all formatting/stylistic changes.
@JinShil
Copy link
Contributor

JinShil commented Nov 20, 2017

Attempted Revival at #7341

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants