Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Do not include compiler-generated names in expression names #3027

Merged
merged 1 commit into from
Aug 24, 2015

Conversation

dougbu
Copy link
Member

@dougbu dougbu commented Aug 23, 2015

- #2890
- add lots of `ExpressionHelper` tests using `IdFor()` and `NameFor()` (which are thin veneers)
@dougbu
Copy link
Member Author

dougbu commented Aug 23, 2015

/cc @Eilon or @rynowak


// If identifier contains "__", it is "reserved for use by the implementation" and likely compiler-
// or Razor-generated e.g. the name of a field in a delegate's generated class.
if (name.Contains("__"))
Copy link
Member

Choose a reason for hiding this comment

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

IIRC __ is only reserved at the start, might want to double check me. I double-checked me, and I was wrong. https://msdn.microsoft.com/en-us/library/aa664670(v=vs.71).aspx

Another way to verify this would probably to look at memberExpressionPart.Member and it's declaring class, which has [CompilerGenerated].

What we have here is probably good enough, but just in case we need to be more certain in the future.

@rynowak
Copy link
Member

rynowak commented Aug 23, 2015

:shipit: looks good based on what I know about this code. if you're unsure, get @Eilon to look at it 😆

@dougbu dougbu merged commit a045324 into dev Aug 24, 2015
@dougbu dougbu deleted the dougbu/lambda.naming.2890 branch August 24, 2015 01:46
@dougbu
Copy link
Member Author

dougbu commented Aug 24, 2015

a045324

dougbu added a commit to aspnet/AspNetWebStack that referenced this pull request Mar 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants