···9595 if a.length == 1 && k.length == 0
9696 a[0]
9797 else
9898- ConstraintType.new(*a, **k)
9898+ ConstraintType.new(a, k)
9999 end
100100 end
101101···234234 end
235235236236 # Matches if the value responds to all the given methods.
237237- def _Interface(...)
238238- InterfaceType.new(...)
237237+ def _Interface(*methods)
238238+ InterfaceType.new(methods)
239239 end
240240241241 # Nilable version of `_Interface`
···246246 end
247247248248 # Matches if *all* given types are matched.
249249- def _Intersection(...)
250250- IntersectionType.new(...)
249249+ def _Intersection(*types)
250250+ IntersectionType.new(types)
251251 end
252252253253 # Nilable version of `_Intersection`
···284284 # ```ruby
285285 # _Map(name: String, age: Integer)
286286 # ```
287287- def _Map(...)
288288- MapType.new(...)
287287+ def _Map(**shape)
288288+ MapType.new(shape)
289289 end
290290291291 # Nilable version of `_Map`
···415415 # ```ruby
416416 # _Tuple(String, Integer, Integer)
417417 # ```
418418- def _Tuple(...)
419419- TupleType.new(...)
418418+ def _Tuple(*types)
419419+ TupleType.new(types)
420420 end
421421422422 # Nilable version of `_Typle`
···430430 end
431431432432 # Matches if *any* given type is matched.
433433- def _Union(...)
434434- UnionType.new(...)
433433+ def _Union(*types)
434434+ UnionType.new(types)
435435 end
436436437437 # Nilable version of `_Union`
···77 # List of `===` method owners where the comparison will only match for objects with the same class
88 OwnClassTypeMethodOwners = Set[String, Integer, Kernel, Float, NilClass, TrueClass, FalseClass].freeze
991010- def initialize(*methods)
1010+ def initialize(methods)
1111 raise Literal::ArgumentError.new("_Interface type must have at least one method.") if methods.size < 1
1212 @methods = methods.to_set.freeze
1313 freeze
+1-1
lib/literal/types/intersection_type.rb
···44class Literal::Types::IntersectionType
55 include Literal::Type
6677- def initialize(*types)
77+ def initialize(types)
88 raise Literal::ArgumentError.new("_Intersection type must have at least one type.") if types.size < 1
991010 @types = types
+1-1
lib/literal/types/map_type.rb
···44class Literal::Types::MapType
55 include Literal::Type
6677- def initialize(**shape)
77+ def initialize(shape)
88 @shape = shape
99 freeze
1010 end
+1-1
lib/literal/types/tuple_type.rb
···44class Literal::Types::TupleType
55 include Literal::Type
6677- def initialize(*types)
77+ def initialize(types)
88 raise Literal::ArgumentError.new("_Tuple type must have at least one type.") if types.size < 1
991010 @types = types
+1-1
lib/literal/types/union_type.rb
···44 include Enumerable
55 include Literal::Type
6677- def initialize(*queue)
77+ def initialize(queue)
88 raise Literal::ArgumentError.new("_Union type must have at least one type.") if queue.size < 1
99 types = []
1010 primitives = Set[]