nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bf8e164
)
syntax: warn on 'while true do' and suggests 'loop'
author
Jean Privat
<jean@pryen.org>
Fri, 28 Aug 2009 15:40:39 +0000
(11:40 -0400)
committer
Jean Privat
<jean@pryen.org>
Fri, 28 Aug 2009 15:40:39 +0000
(11:40 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>
src/syntax/typing.nit
patch
|
blob
|
history
diff --git
a/src/syntax/typing.nit
b/src/syntax/typing.nit
index
70e7d5d
..
f9fb4a6
100644
(file)
--- a/
src/syntax/typing.nit
+++ b/
src/syntax/typing.nit
@@
-540,6
+540,10
@@
redef class AWhileExpr
v.enter_visit(n_expr)
v.check_conform_expr(n_expr, v.type_bool)
+ if n_expr isa ATrueExpr then
+ v.warning(self, "Warning: use 'loop' instead of 'while true do'.")
+ end
+
# Prepare inside context (assert cond)
v.use_if_true_variable_ctx(n_expr)