nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
86903f4
)
modelize_classes: warn on parameter types bounded on final classes
author
Jean Privat
<jean@pryen.org>
Thu, 24 Jul 2014 18:07:46 +0000
(14:07 -0400)
committer
Jean Privat
<jean@pryen.org>
Thu, 24 Jul 2014 18:37:23 +0000
(14:37 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>
src/modelize_class.nit
patch
|
blob
|
history
diff --git
a/src/modelize_class.nit
b/src/modelize_class.nit
index
09b7081
..
b00508b
100644
(file)
--- a/
src/modelize_class.nit
+++ b/
src/modelize_class.nit
@@
-154,6
+154,9
@@
redef class ModelBuilder
bounds.add(bound)
nfd.bound = bound
end
+ if bound isa MClassType and bound.mclass.kind == enum_kind then
+ warning(nfdt, "Warning: Useless formal parameter type since `{bound}` cannnot have subclasses.")
+ end
else if mclass.mclassdefs.is_empty then
# No bound, then implicitely bound by nullable Object
var bound = objectclass.mclass_type.as_nullable