nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
nitg: self type in implicit init is exact
[nit.git]
/
src
/
global_compiler.nit
diff --git
a/src/global_compiler.nit
b/src/global_compiler.nit
index
0aaf69b
..
4264999
100644
(file)
--- a/
src/global_compiler.nit
+++ b/
src/global_compiler.nit
@@
-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)};")