<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>numb_86</author_name>
  <author_url>https://blog.hatena.ne.jp/numb_86/</author_url>
  <blog_title>30歳からのプログラミング</blog_title>
  <blog_url>https://numb86-tech.hatenablog.com/</blog_url>
  <categories>
    <anon>TypeScript</anon>
  </categories>
  <description>「発生し得ない値」などのように説明されるnever型。 概念としては分かるのだが、実際にどのようなケースで使えばよいのかイメージできずにいた。 neverを使ったテクニックを調べていて多少のイメージは掴めてきたので、整理しておく。 動作確認は TypeScript のv3.7.5で行っている。 never 型の特性 まずはnever型がどういった型なのか、理解する。 決して発生し得ない値や型は、never型になる。 例えば以下のif文では、elseブロックは絶対に実行されないため、そのなかではfooはneverになる。 const foo = true; if (foo) { foo; // …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnumb86-tech.hatenablog.com%2Fentry%2F2020%2F02%2F06%2F214324&quot; title=&quot;never 型を使った TypeScript のテクニック - 30歳からのプログラミング&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>2020-02-06 21:43:24</published>
  <title>never 型を使った TypeScript のテクニック</title>
  <type>rich</type>
  <url>https://numb86-tech.hatenablog.com/entry/2020/02/06/214324</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
