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

If column name is value, the import value will not get assigned #62

Open
WeAthFoLD opened this issue Oct 23, 2018 · 3 comments
Open

If column name is value, the import value will not get assigned #62

WeAthFoLD opened this issue Oct 23, 2018 · 3 comments

Comments

@WeAthFoLD
Copy link

WeAthFoLD commented Oct 23, 2018

Say I got a excel sheet like

key value
A B
AA BB

The code generated for the value row would be

[SerializeField]
  string value;
  public string Value { get {return value; } set { value = value;} }

Making that value never get assigned. I would suggest adding changing setter to this.value = value to avoid ambiguity.

@WeAthFoLD WeAthFoLD changed the title If row value is named value, the import value will not get assigned If column name is value, the import value will not get assigned Oct 23, 2018
@kimsama
Copy link
Owner

kimsama commented Jun 3, 2019

Please, change the column name. 'value' is a keyword.

Cheers,

@WeAthFoLD
Copy link
Author

WeAthFoLD commented Jun 3, 2019

I'd argue that it's confusing to consider in the context of an excel sheet, that value is an keyword. It's valid in the world of C#, but spreadsheets has nothing to do with C#.

Furthermore, value is a contextual keyword, which means it's only considered a keyword in getter/setters. If we fix on the idea that column shouldn't be C# keyword, then it also can't be for,while,if,else, and so many others, which is IMO very weird.

Cheers.

@kimsama
Copy link
Owner

kimsama commented Jun 4, 2019

Oops, I totally misunderstood the context. Yes, right. Even it seems to be no harm.
Would you like to change the code and do merge request, if you don't mind? Please, see the WriteProperty method in ScriptGenerator.cs file. There is where the change should be done. Thanks in advance.

Cheers,

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