~duangle/scopes#13: 
swizzle of a reference of a glm vector yields incorrect type.

repro:

using import testing
using import glm

let v1 = (vec4)
test
    (typeof v1.st) == vec2

local v2 : vec4
dump (typeof v2.st) # vec4(vectorof i32 0 1)
test
    (typeof v2.st) == vec2
Status
RESOLVED BY_DESIGN
Submitter
~radgerayden
Assigned to
No-one
Submitted
2 years ago
Updated
1 year, 10 months ago
Labels
No labels applied.

~duangle 2 years ago

This is actually not a bug. The repr string could be more helpful, but the type that's returned here is of supertype vec-type-accessor, and has to be cast to vec2 manually: (v2.st as vec2). This happens when the source value is a reference, so that the accessor can be used to perform assignments.

~radgerayden REPORTED BY_DESIGN 1 year, 10 months ago

Register here or Log in to comment, or comment via email.