Skip to content

Incorrect no block given message with new #233

Closed
@asterite

Description

class Person
  property :name, :age

  def initialize(@name = nil, @age = nil)
    yield self
  end
end

person = Person.new do |p|
  p.name = "Jacob"
  p.age = "25"
end

Incorrectly complains:

Error in /Users/asterite-manas/Projects/crystal/coco.cr:13: no block given

person = Person.new do |p|
                ^~~

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions