syntax: allow untyped variable declaration
[nit.git] / src / syntax / control_flow.nit
index 4b8d0fc..dd3ca06 100644 (file)
@@ -53,6 +53,8 @@ abstract class VariableContext
        do
                if v.must_be_set and not is_set(v) then
                        _visitor.error(n, "Error: variable '{v}' is possibly unset.")
+               else if v.is_typed and stype(v) == null then
+                       _visitor.error(n, "Error: variable '{v}' is untyped.")
                end
        end