We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Vector3
iOS, macOS, Mac Catalyst, tvOS
net9.0-*
9.0.101
When a class contains two consecutive Vector3 fields, setting the value for the first will modify the first inner field (X) of the second field.
X
Add the following code to an app, then run, the error message should not happen:
public partial class MyTestClass { private Vector3 _offset; private Vector3 _scale = new Vector3(1, 1, 1); internal static void RunTest() { var v1 = new MyTestClass(); System.Console.WriteLine($"Scale: {v1.Scale} Offset: {v1.Offset} Scale: {v1.Scale}"); var v2 = new MyTestClass() { Offset = new(1.1f, 1.1f, 5.0f) }; System.Console.WriteLine($"Scale: {v2.Scale} Offset: {v2.Offset} Scale: {v2.Scale}"); if(v2.Scale != new Vector3(1, 1, 1)) { System.Console.WriteLine("Error: Scale is not 1, 1, 1"); } } public Vector3 Offset { get => _offset; set { System.Console.WriteLine($"Before Offset: {Offset} Scale: {Scale}"); _offset = value; System.Console.WriteLine($"After Offset: {Offset} Scale: {Scale}"); } } public Vector3 Scale => _scale; }
Repro project: 21825-iosllvmissue.zip
Adding a field of another type in between seems to works around the issue.
No response
The text was updated successfully, but these errors were encountered:
I can reproduce this in the iOS simulator, by building like this:
dotnet build /p:Configuration=Release -f net9.0-ios
Output:
Scale: <1, 1, 1> Offset: <0, 0, 0> Scale: <1, 1, 1> Before Offset: <0, 0, 0> Scale: <1, 1, 1> After Offset: <1.1, 1.1, 5> Scale: <0, 1, 1> Scale: <0, 1, 1> Offset: <1.1, 1.1, 5> Scale: <0, 1, 1> Error: Scale is not 1, 1, 1
Moving to dotnet/runtime, since this looks like a codegen issue.
Sorry, something went wrong.
This issue was moved to dotnet/runtime#110820
No branches or pull requests
Apple platform
iOS, macOS, Mac Catalyst, tvOS
Framework version
net9.0-*
Affected platform version
9.0.101
Description
When a class contains two consecutive
Vector3
fields, setting the value for the first will modify the first inner field (X
) of the second field.Steps to Reproduce
Add the following code to an app, then run, the error message should not happen:
Repro project: 21825-iosllvmissue.zip
Did you find any workaround?
Adding a field of another type in between seems to works around the issue.
Relevant logs
No response
The text was updated successfully, but these errors were encountered: