nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
86d402a
)
typing: check missing return in AAttrPropdef with block
author
Jean Privat
<jean@pryen.org>
Tue, 20 Jan 2015 04:04:07 +0000
(11:04 +0700)
committer
Jean Privat
<jean@pryen.org>
Tue, 20 Jan 2015 04:04:07 +0000
(11:04 +0700)
Signed-off-by: Jean Privat <jean@pryen.org>
src/semantize/typing.nit
patch
|
blob
|
history
diff --git
a/src/semantize/typing.nit
b/src/semantize/typing.nit
index
8fb3852
..
343edbd
100644
(file)
--- a/
src/semantize/typing.nit
+++ b/
src/semantize/typing.nit
@@
-609,6
+609,10
@@
redef class AAttrPropdef
var nblock = self.n_block
if nblock != null then
v.visit_stmt(nblock)
+ if not nblock.after_flow_context.is_unreachable then
+ # We reach the end of the init without having a return, it is bad
+ v.error(self, "Control error: Reached end of block (a 'return' with a value was expected).")
+ end
end
end
end