<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kmizushima</author_name>
  <author_url>https://blog.hatena.ne.jp/kmizushima/</author_url>
  <blog_title>kmizuの日記</blog_title>
  <blog_url>https://kmizu.hatenablog.com/</blog_url>
  <categories>
    <anon>Kotlin</anon>
  </categories>
  <description>Kotlinでは、一つの式からなる関数は fun add(x: Int, y: Int): Int = x + y のように明示的なreturnを必要としません。次のように複数の式からなる関数定義ではreturnが必須となります。 fun printAndAdd(x: Int, y: Int): Int { val k = x + y println(k) return k //必須 } この制限の理由について、Kotlinのリファレンスでは Kotlin does not infer return types for functions with block bodies because s…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkmizu.hatenablog.com%2Fentry%2F2016%2F03%2F22%2F134828&quot; title=&quot;Kotlinのブロックからなる関数定義でreturnを書かなくて良いようにする - kmizuの日記&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>2016-03-22 13:48:28</published>
  <title>Kotlinのブロックからなる関数定義でreturnを書かなくて良いようにする</title>
  <type>rich</type>
  <url>https://kmizu.hatenablog.com/entry/2016/03/22/134828</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
