-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Object's property is not found when invoking function for 1st time, it is found on 2nd time #48088
Comments
I would guess this might be an issue with MeshIO and not base Julia. |
@sefffal It might be an issue with MeshIO. However, the behavior that I am seeing is very weird - it really seems something is off with the language.
The return type is the same in both cases (via
The return type looks correct (and, in both cases, There is also another very weird thing: If I run this same code, but within a function, then the issue always happens. Example:
Now suddenly |
A quick glance at the MeshIO code seems to show attributes of the Mesh object are determined at runtime based on a variety of conditions, including |
Yes, attributes are determined at runtime, hence why I was performing this check in the first place. In my example, however, I am always loading the same mesh, which has normals. Therefore, the normals should always be there (and they are always there if I don't run the code from within a function). It could be a bug in MeshIO? I suppose so, but the fact that the behavior changes if I run the exact same code from within a function or not, or by running a second time, is what made me believe this was not solely related to MeshIO. |
I found a fix. It turns out that code was lacking Thanks for the responses! |
As noted by vjtnash method definitions can change between top-level invocations but not within a function call (unless invokelatest is used). |
Hello, I am facing an weird issue. The property of an object (
:normals
) is not being found, even though it is there.It seems that the issue is happening because I am invoking the code from within a function. If the code is executed outside the function, then it works as expected. Also, if I execute the function a second time using the same kernel, then it finds the property!
The behavior seems somewhat random, but it is very easy to reproduce.
Minimal working example:
Needs the cube.obj file:
Additional info:
Output of versioninfo():
Installed julia by downloading x64 binaries for Linux (glibc)
The text was updated successfully, but these errors were encountered: