62d2d62447ab — Leonard Ritter a month ago
* small extension to GLM test
* vector accessors use new repr format
2 files changed, 12 insertions(+), 1 deletions(-)

M lib/scopes/glm.sc
M testing/test_glm.sc
M lib/scopes/glm.sc +2 -1
@@ 452,12 452,13 @@ typedef+ vec-type
 
     @@ memoize
     fn construct-getter-type (vecrefT mask)
+        print vecrefT mask
         let storageT = ('storageof vecrefT)
         let ET = ('element@ storageT 0)
         let sz = ('element-count ('typeof mask))
         let lhsz = ('element-count vecrefT)
         @@ spice-quote
-        typedef [(.. ('string vecrefT) (tostring mask))]
+        typedef [(.. ('string vecrefT) "." (tostring mask))]
             \ < vec-type-accessor : storageT
             let
                 RHVectorType = (construct-vec-type ET sz)

          
M testing/test_glm.sc +10 -0
@@ 213,6 213,16 @@ do
 test ((floor (ivec2 1 2)) == (ivec2 1 2))
 test ((floor (vec2 1.5 2.5)) == (vec2 1 2))
 
+do
+    # bug #13
+    let v1 = (vec4)
+    test
+        (typeof v1.st) == vec2
+
+    local v2 : vec4
+    test
+        (typeof (v2.st as vec2)) == vec2
+
 #let m = (mat3 m)
 #print m