Giter Club home page Giter Club logo

Comments (1)

KotzaBoss avatar KotzaBoss commented on July 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.