Skip to content

Commit

Permalink
Merge pull request #564 from kachick/fix-typo
Browse files Browse the repository at this point in the history
Fix some typos
  • Loading branch information
soutaro authored Jun 10, 2022
2 parents 8c36ed2 + 353a24e commit 15ecbb0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/steep/ast/builtin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def instance_type(*args, fill_untyped: false)
args << Builtin.any_type
end
end
arity == args.size or raise "Mulformed instance type: name=#{module_name}, args=#{args}"
arity == args.size or raise "Malformed instance type: name=#{module_name}, args=#{args}"

Types::Name::Instance.new(name: module_name, args: args)
end
Expand All @@ -28,7 +28,7 @@ def module_type
def instance_type?(type, args: nil)
if type.is_a?(Types::Name::Instance)
if args
arity == args.size or raise "Mulformed instance type: name=#{module_name}, args=#{args}"
arity == args.size or raise "Malformed instance type: name=#{module_name}, args=#{args}"
type.name == module_name && type.args == args
else
type.name == module_name && type.args.size == arity
Expand Down
6 changes: 3 additions & 3 deletions lib/steep/subtyping/variable_occurrence.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Steep
module Subtyping
class VariableOccurence
class VariableOccurrence
attr_reader :params
attr_reader :returns

Expand Down Expand Up @@ -42,8 +42,8 @@ def strictly_return?(var)
end

def self.from_method_type(method_type)
self.new.tap do |occurence|
occurence.add_method_type(method_type)
self.new.tap do |occurrence|
occurrence.add_method_type(method_type)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/steep/type_construction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3335,7 +3335,7 @@ def try_method_type(node, receiver_type:, method_name:, method_type:, arguments:
method_type = method_type.instantiate(instantiation)

variance = Subtyping::VariableVariance.from_method_type(method_type)
occurence = Subtyping::VariableOccurence.from_method_type(method_type)
occurrence = Subtyping::VariableOccurrence.from_method_type(method_type)
constraints = Subtyping::Constraints.new(unknowns: type_params.map(&:name))
ccontext = Subtyping::Constraints::Context.new(
self_type: self_type,
Expand Down
6 changes: 3 additions & 3 deletions test/type_construction_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3049,7 +3049,7 @@ def test_rescue_typing
end
end

def test_rescue_bidning_typing
def test_rescue_binding_typing
with_checker do |checker|
source = parse_ruby(<<EOF)
# @type const E: singleton(String)
Expand Down Expand Up @@ -5067,7 +5067,7 @@ def test_unless_return
end
end

def test_and_occurence
def test_and_occurrence
with_checker do |checker|
source = parse_ruby(<<EOF)
(x = [1,nil][0]) && x + 1
Expand All @@ -5086,7 +5086,7 @@ def test_and_occurence
end
end

def test_or_occurence
def test_or_occurrence
with_checker do |checker|
source = parse_ruby(<<EOF)
x = [1,nil][0]
Expand Down

0 comments on commit 15ecbb0

Please sign in to comment.