nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
typing: Make `TypeVisitor::mpropdef` non-nullable
[nit.git]
/
src
/
semantize
/
typing.nit
diff --git
a/src/semantize/typing.nit
b/src/semantize/typing.nit
index
1e15a05
..
532d146
100644
(file)
--- a/
src/semantize/typing.nit
+++ b/
src/semantize/typing.nit
@@
-46,7
+46,7
@@
private class TypeVisitor
var mclassdef: nullable MClassDef = null
# The analyzed property
var mclassdef: nullable MClassDef = null
# The analyzed property
- var mpropdef: nullable MPropDef
+ var mpropdef: MPropDef
var selfvariable = new Variable("self")
var selfvariable = new Variable("self")
@@
-59,22
+59,19
@@
private class TypeVisitor
init
do
var mpropdef = self.mpropdef
init
do
var mpropdef = self.mpropdef
+ var mclassdef = mpropdef.mclassdef
+ self.mclassdef = mclassdef
+ self.anchor = mclassdef.bound_mtype
- if mpropdef != null then
- var mclassdef = mpropdef.mclassdef
- self.mclassdef = mclassdef
- self.anchor = mclassdef.bound_mtype
-
- var mclass = mclassdef.mclass
+ var mclass = mclassdef.mclass
- var selfvariable = new Variable("self")
- self.selfvariable = selfvariable
- selfvariable.declared_type = mclass.mclass_type
+ var selfvariable = new Variable("self")
+ self.selfvariable = selfvariable
+ selfvariable.declared_type = mclass.mclass_type
- var mprop = mpropdef.mproperty
- if mprop isa MMethod and mprop.is_new then
- is_toplevel_context = true
- end
+ var mprop = mpropdef.mproperty
+ if mprop isa MMethod and mprop.is_new then
+ is_toplevel_context = true
end
end
end
end