nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib/core: remove ascii method on Int and 'b' prefix
[nit.git]
/
src
/
semantize
/
typing.nit
diff --git
a/src/semantize/typing.nit
b/src/semantize/typing.nit
index
8890ba9
..
3463b07
100644
(file)
--- a/
src/semantize/typing.nit
+++ b/
src/semantize/typing.nit
@@
-1577,9
+1577,7
@@
end
redef class ACharExpr
redef fun accept_typing(v) do
var mclass: nullable MClass = null
redef class ACharExpr
redef fun accept_typing(v) do
var mclass: nullable MClass = null
- if is_ascii then
- mclass = v.get_mclass(self, "Byte")
- else if is_code_point then
+ if is_code_point then
mclass = v.get_mclass(self, "Int")
else
mclass = v.get_mclass(self, "Char")
mclass = v.get_mclass(self, "Int")
else
mclass = v.get_mclass(self, "Char")
@@
-2017,6
+2015,10
@@
redef class AEqFormExpr
if mtype == null or mtype2 == null then return
if mtype == null or mtype2 == null then return
+ if mtype == v.type_bool(self) and (n_expr2 isa AFalseExpr or n_expr2 isa ATrueExpr) then
+ v.modelbuilder.warning(self, "useless-truism", "Warning: useless comparison to a Bool literal.")
+ end
+
if not mtype2 isa MNullType then return
v.check_can_be_null(n_expr, mtype)
if not mtype2 isa MNullType then return
v.check_can_be_null(n_expr, mtype)