Comments (1)
Could this perhaps be linked to a similar issue i have?
https://discord.com/channels/568138951836172421/1244966374280003640
package err
import "core:testing"
import rl "vendor:raylib"
@test
t1 :: proc(t: ^testing.T) {
Unit :: struct {
target: union{ rl.Vector3 },
}
units := make_soa(#soa[dynamic]Unit, 5)
ptrs := make([dynamic]#soa^ #soa[]Unit, 5)
all := units[:]
for _, i in all {
ptrs[i] = &all[i]
}
for p, i in ptrs {
// This seems to be the problem
p.target = rl.Vector3{auto_cast i, auto_cast i, auto_cast i}
}
for u, i in units {
testing.expect_value(t, u.target, rl.Vector3{auto_cast i, auto_cast i, auto_cast i})
}
}
~/git/Odin/odin test err.odin -file
err.t1
lb_emit_conv: src -> dst
Not Identical [3]f32 != [^]union {[3]f32}
Not Identical [3]f32 != [^]union {[3]f32}
Not Identical 7fc0bba58280 != 7fc0a0a49720
Not Identical 7fc0bba58280 != 7fc0a0a49720
src/llvm_backend_expr.cpp(2324): Panic: Invalid type conversion: '[3]f32' to '[^]union {[3]f32}' for procedure 'err.t1'
[1] 7329 illegal hardware instruction (core dumped) ~/git/Odin/odin test invalid_type_conversion.odin -file
from odin.
Related Issues (20)
- Performing && or || on boolean arrays causes compiler to panic HOT 1
- "Maybe" assignment failing on struct initilization HOT 6
- Breaking from a loop in defer causes a compiler seg fault
- Suggest Slice Operator When Using [dynamic] on Polymorphic Type Parameter Looking for Slice
- A slice marked with @(rodata) can still be modified (and won't throw an error)
- When Accessing a Slice in an rodata struct, it can still be modified HOT 1
- @(rodata) doesn't work with slices of unions HOT 1
- Compiler crashes when building with spall HOT 4
- Compiler crashes on an array of values with different types, which has "using"
- Using all implicit swizzle fields on a array pointer causes CPP assertion.
- Syntax errors when declaring a multi-line procedure
- Problems with precision when using `linalg.angle_between` HOT 1
- JSON Parsing Issue (Float field)
- Cannot cast untyped bool to integer
- match.gsub() does not capture patterns after unicode characters HOT 1
- Cannot use global matrices with variables as index
- GuiTextInputBox and GuiTextBox from vendor/raylib/raygui.odin immediately crash my program. HOT 2
- Compiler Crash(?) when trying to add More If/Else Braches HOT 5
- Compiler crashes when trying to assign i32 to Maybe(any) HOT 2
- Union variant type not promoted to union in `in` expression for hash map.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from odin.