Skip to content

Commit

Permalink
typing: allow --keepgoing on null and protected calls
Browse files Browse the repository at this point in the history
This does not change that much

Signed-off-by: Jean Privat <[email protected]>
  • Loading branch information
privat committed Aug 15, 2024
1 parent e8e9cca commit 55ee70e
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/semantize/typing.nit
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ private class TypeVisitor
# `null` only accepts some methods of object.
if recvtype isa MNullType and not mproperty.is_null_safe then
self.error(node, "Error: method `{mproperty.name}` called on `null`.")
return null
else if unsafe_type isa MNullableType and not mproperty.is_null_safe then
modelbuilder.advice(node, "call-on-nullable", "Warning: method call on a nullable receiver `{recvtype}`.")
end
Expand All @@ -378,7 +377,6 @@ private class TypeVisitor

if mproperty.visibility == protected_visibility and not recv_is_self and self.mmodule.visibility_for(mproperty.intro_mclassdef.mmodule) < intrude_visibility and not modelbuilder.toolcontext.opt_ignore_visibility.value then
self.modelbuilder.error(node, "Error: method `{mproperty.name}` is protected and can only accessed by `self`.")
return null
end

var info = mproperty.deprecation
Expand Down

0 comments on commit 55ee70e

Please sign in to comment.