module Dry::Schema::Macros

def call(*args)

def call(*args)
  if args.size >= 1 && struct?(args[0])
    if block_given?
      raise ArgumentError, "blocks are not supported when using "\
                           "a struct class (#{name.inspect} => #{args[0]})"
    end
    schema = struct_compiler.(args[0])
    super(schema, *args.drop(1))
    type(schema_dsl.types[name].constructor(schema))
  else
    super
  end
end

def struct?(type)

def struct?(type)
  type.is_a?(::Class) && type <= ::Dry::Struct
end