<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>falsandtru</author_name>
  <author_url>https://blog.hatena.ne.jp/falsandtru/</author_url>
  <blog_title>falsandtruのメモ帳</blog_title>
  <blog_url>https://falsandtru.hatenablog.com/</blog_url>
  <categories>
    <anon>TypeScript</anon>
  </categories>
  <description>TypeScriptにはanyを使わないよう注意しても型検査が無効化され型安全性が失われるパターンがいくつかあり、中には致命的なものも存在する。今回はこのパターンをいくつか紹介する。 コールバックのvoid戻り値型 コールバックのvoid戻り値型はすべての型を受け入れるためvoid型 === any型となる。 function f(cb: (a: number) =&gt; void): void { return cb(0); } function g(a: number): number { return a; } f(g); このためvoid型の値はvoid演算子を使用して即座に強制的にvoi…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffalsandtru.hatenablog.com%2Fentry%2Funsafe-typescript&quot; title=&quot;TypeScriptの型検査を無効化して型安全性を失わせる落とし穴5つとその避け方 - falsandtruのメモ帳&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-01-19 00:00:00</published>
  <title>TypeScriptの型検査を無効化して型安全性を失わせる落とし穴5つとその避け方</title>
  <type>rich</type>
  <url>https://falsandtru.hatenablog.com/entry/unsafe-typescript</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
