nitg: self type in implicit init is exact
authorJean Privat <jean@pryen.org>
Mon, 6 Aug 2012 21:08:57 +0000 (17:08 -0400)
committerJean Privat <jean@pryen.org>
Tue, 7 Aug 2012 04:54:33 +0000 (00:54 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/global_compiler.nit

index 0aaf69b..4264999 100644 (file)
@@ -319,6 +319,7 @@ private class GlobalCompiler
                v.add_decl("/* allocate {mtype} */")
                v.add_decl("{mtype.ctype} NEW_{mtype.c_name}(void) \{")
                var res = v.new_var(mtype)
+               res.is_exact = true
                v.add("{res} = GC_MALLOC(sizeof(struct {mtype.c_name}));")
                v.add("{res}->classid = {self.classid(mtype)};")