{"action":"created","issue":{"url":"https://api.github.com/repos/crystal-lang/crystal/issues/2531","repository_url":"https://api.github.com/repos/crystal-lang/crystal","labels_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2531/labels{/name}","comments_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2531/comments","events_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2531/events","html_url":"https://github.com/crystal-lang/crystal/issues/2531","id":151823656,"number":2531,"title":"Bug on checking property class","user":{"login":"semenovDL","id":2780315,"avatar_url":"https://avatars.githubusercontent.com/u/2780315?v=3","gravatar_id":"","url":"https://api.github.com/users/semenovDL","html_url":"https://github.com/semenovDL","followers_url":"https://api.github.com/users/semenovDL/followers","following_url":"https://api.github.com/users/semenovDL/following{/other_user}","gists_url":"https://api.github.com/users/semenovDL/gists{/gist_id}","starred_url":"https://api.github.com/users/semenovDL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/semenovDL/subscriptions","organizations_url":"https://api.github.com/users/semenovDL/orgs","repos_url":"https://api.github.com/users/semenovDL/repos","events_url":"https://api.github.com/users/semenovDL/events{/privacy}","received_events_url":"https://api.github.com/users/semenovDL/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/crystal-lang/crystal/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/crystal-lang/crystal/labels/compiler","name":"compiler","color":"fef2c0"},{"url":"https://api.github.com/repos/crystal-lang/crystal/labels/needs%20more%20info","name":"needs more info","color":"C53BEB"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-04-29T09:09:57Z","updated_at":"2016-05-04T11:46:36Z","closed_at":null,"body":"When try to check property class:\r\n```ruby\r\nclass A\r\n  def initialize(values)\r\n    @values = [] of B\r\n  end\r\n  \r\n  def to_s\r\n    if @values.is_a?(Array)\r\n\t    @values.map(&.name).join(\"\\n\")\r\n\t  end\r\n  end\r\nend\r\n\r\nclass B\r\n  property name\r\n  def initialize(@name)\r\n  end\r\nend\r\n\r\nvalues = ('a'..'z').to_a.map { |s| B.new(s) }\r\nputs A.new(values).to_s\r\n```\r\nGet expection\r\n`Bug: trying to downcast String? <- String`"},"comment":{"url":"https://api.github.com/repos/crystal-lang/crystal/issues/comments/216836648","html_url":"https://github.com/crystal-lang/crystal/issues/2531#issuecomment-216836648","issue_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2531","id":216836648,"user":{"login":"asterite","id":209371,"avatar_url":"https://avatars.githubusercontent.com/u/209371?v=3","gravatar_id":"","url":"https://api.github.com/users/asterite","html_url":"https://github.com/asterite","followers_url":"https://api.github.com/users/asterite/followers","following_url":"https://api.github.com/users/asterite/following{/other_user}","gists_url":"https://api.github.com/users/asterite/gists{/gist_id}","starred_url":"https://api.github.com/users/asterite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asterite/subscriptions","organizations_url":"https://api.github.com/users/asterite/orgs","repos_url":"https://api.github.com/users/asterite/repos","events_url":"https://api.github.com/users/asterite/events{/privacy}","received_events_url":"https://api.github.com/users/asterite/received_events","type":"User","site_admin":false},"created_at":"2016-05-04T11:46:36Z","updated_at":"2016-05-04T11:46:36Z","body":"Doesn't happen to me, and it doesn't happen in play: https://play.crystal-lang.org/#/r/xw0\r\n\r\nI don't know why it's failing for you. Could you please also try the snippet in play.crystal-lang.org before submitting it here? If it doesn't fail in play there must be something wrong with your crystal installation."}}