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

Properties with the aliases that match keywords fail #3

Open
drpeck opened this issue Jun 20, 2016 · 3 comments
Open

Properties with the aliases that match keywords fail #3

drpeck opened this issue Jun 20, 2016 · 3 comments

Comments

@drpeck
Copy link

drpeck commented Jun 20, 2016

One of my content type property aliases is called 'abstract'. While potentially short sighted this makes sense from an article perspective but as you're using the alias when building the POCOs I'm getting an error when trying to connect to my website path.
Exception - Cannot compile typed context: Member modifier 'abstract' must precede the member type and name

I can see where to escape the member name in your solution but I've no idea where I'll then have to unescape it.

No worries about fixing this for me, as I'll take another approach, but I thought I'd log the issue.

@Shazwazza
Copy link
Owner

Cool, thx for logging it. I haven't used this codebase for a while now so if you can point me to where you'd escape and can see if it'd be easy to fix everywhere.

@drpeck
Copy link
Author

drpeck commented Jun 20, 2016

While I was going to escape it in
UmbracoLinqPad.Gateway.Compilers.ContentItemsCompiler.BuildClass() on line 51

Initially I was hackily just going to skip those values:
if (new[] { "abstract", "public", "protected", "internal", "private", "sealed", "virtual" }.Any(s => s == property)) continue;
but prefixing it with 3 underscores might be better

@drpeck
Copy link
Author

drpeck commented Jun 20, 2016

Argh... brain not working on a Monday after #cg16 clearly. I'm sure you already realised but prefixing it like @abstract would probably sort it.

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

No branches or pull requests

2 participants