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

C++/CLI generator does not create implementations for static fields (variables) #362

Open
ddobrev opened this issue Nov 2, 2014 · 6 comments

Comments

@ddobrev
Copy link
Contributor

ddobrev commented Nov 2, 2014

Static fields (variables) are represented as properties but the C++/CLI generator only creates definitions in headers for those. To reproduce, move:

static int null;

from CSharpTemp.h to Basic.h.

@genuinelucifer
Copy link
Contributor

I was trying to recreate this issue.. But,
I could NOT find "static int null;" in CSharpTemp.h!!
What am i missing??

@ddobrev
Copy link
Contributor Author

ddobrev commented May 13, 2015

No idea what's happened here. Just add such a member to Basic.h and regenerate to see if there's any problem.

@genuinelucifer
Copy link
Contributor

@ddobrev Here is what I tried to recreate the issue :
https://gist.github.com/genuinelucifer/82c983dd3087a3bb37a1
I added two global variables and 2 private variable in Foo class (1 static and one non-static in each case) in the Basic.h file...
None of the 4 variables were generated in Basic.h or Basic.cpp (in vs2013/gen/Basic/)
only 1 out of the 4 (only the non-static class member 'normalFooTest') was generated in Basic.cs, the other 3 were NOT generated!
.
Is this some fault on my side or is the issue really this big?

@ddobrev
Copy link
Contributor Author

ddobrev commented May 13, 2015

static int staticFooTest; is private so it shouldn't be generated. The two outside the class should be generated in another class, not in Foo.
About C++/CLI, there should be a property generated for a public static field of a class so make sure you test with a public member.

@genuinelucifer
Copy link
Contributor

@ddobrev My main concern is that the global variables are nowhere generated. I added one static and one non-static global variable in Basic.h and none of them was generated in either Basic.cs or in the Basic.h/cpp files!
Am i doing something wrong or is this the issue?

@ddobrev
Copy link
Contributor Author

ddobrev commented May 13, 2015

I am afraid I'm a little busy. Please solve the other issue first and then we'll get back to this one.

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