nitc :: FlowContext :: set_var
Warning1: do not modify vars directly. Warning2: sub-flow may have cached a unadapted variable
# Adapt the variable to a static type
# Warning1: do not modify vars directly.
# Warning2: sub-flow may have cached a unadapted variable
private fun set_var(v: TypeVisitor, variable: Variable, mtype: nullable MType)
do
if variable.declared_type == mtype and not variable.is_adapted then return
if vars.has_key(variable) and vars[variable] == mtype then return
self.vars[variable] = mtype
v.dirty = true
variable.is_adapted = true
#node.debug "set {variable} to {mtype or else "X"}"
end
src/semantize/typing.nit:840,2--851,4