From d7cae8670fbc0ab46b694f7be3414694bdb5e544 Mon Sep 17 00:00:00 2001 From: treeform Date: Sat, 20 Nov 2021 22:26:05 -0800 Subject: [PATCH] Fix https://github.com/treeform/vmath/issues/45 --- tests/test.nim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test.nim b/tests/test.nim index 42bb920..d2b7d5a 100644 --- a/tests/test.nim +++ b/tests/test.nim @@ -904,3 +904,17 @@ block: # Test for https://github.com/treeform/vmath/issues/44 doAssert PI.toDegrees() == 180 doAssert (PI*2).toDegrees() == 360 + +block: + # Test for https://github.com/treeform/vmath/issues/45 + block: + let a = uvec2(10, 10) + var b: UVec2 + when compiles(b = a / 2): doAssert false # type mismatch + b = a div 2 + + block: + let a = vec2(10, 10) + var b: Vec2 + b = a / 2 + when compiles(b = a div 2): doAssert false # type mismatch