nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
8557e08
)
nitg: self type in implicit init is exact
author
Jean Privat
<jean@pryen.org>
Mon, 6 Aug 2012 21:08:57 +0000
(17:08 -0400)
committer
Jean 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
patch
|
blob
|
history
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)};")