Skip to content

Declare type with implicit cast #461

Answered by zeux
morgoth990 asked this question in Q&A
Discussion options

You must be logged in to vote

Classes can't be implicitly converted to each other unless they share a common parent. You could model these as table types I suppose, or alternatively you can use vec2 as a parent of vec3, even though this is a little odd, but that'd give you an ability to pass a vec3 instance to a function that expects vec2.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@alexmccord
Comment options

Answer selected by morgoth990
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants