<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>nokturnalmortum</author_name>
  <author_url>https://blog.hatena.ne.jp/nokturnalmortum/</author_url>
  <blog_title>地獄のネコブログ</blog_title>
  <blog_url>https://anekos.hatenablog.com/</blog_url>
  <categories>
    <anon>PG</anon>
  </categories>
  <description>さて、getFavoriteAnimal() 関数内の変数 animal は、何の型としてコンパイルされるべきでしょう?こういう場合はおっしゃる通りわからないと思うので、コンパイラさんは「わかんないー」って言えばいいんじゃないでしょうか。 んで、仕方がないから、ちゃんと宣言して使うと。 弾さんの元記事のは型推論オンリーじゃなくて、できるときに楽ちんぐらいのもんだと私は思ってました。 どちらにせよ、変数 animal は事前に型宣言が必要になってしまいます。 だから、これはその通りですが、型推論あったら便利でいいじゃん！ということなんじゃないかなぁと。 というのも、キャストしてやれば問題ないよう…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fanekos.hatenablog.com%2Fentry%2F20061201%2F1164974656&quot; title=&quot;型宣言の必要性 - 地獄のネコブログ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2006-12-01 21:04:16</published>
  <title>型宣言の必要性</title>
  <type>rich</type>
  <url>https://anekos.hatenablog.com/entry/20061201/1164974656</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
