<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>hokaccha</author_name>
  <author_url>https://blog.hatena.ne.jp/hokaccha/</author_url>
  <blog_title>hokaccha memo</blog_title>
  <blog_url>https://hokaccha.hatenablog.com/</blog_url>
  <categories>
    <anon>TypeScript</anon>
  </categories>
  <description>const obj: any = { a: 1, b: &quot;x&quot; }; function foo&lt;T, U&gt;(x: U): [T, U] { return [obj[x], x]; } こういうコードがあったとする。コードの良し悪しは置いといて、U は引数から推論して、T は呼び出す側から指定したいというケース。 // こう書きたいけどエラー foo&lt;number&gt;(&quot;a&quot;); // Expected 2 type arguments, but got 1 // これは通る foo&lt;number, string&gt;(&quot;a&quot;); これは今現在（TypeScript 4.0）ではできないみたいで、Pr…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhokaccha.hatenablog.com%2Fentry%2F2020%2F08%2F26%2F101041&quot; title=&quot;TypeScript でジェネリクスの部分的な型推論ができない - hokaccha memo&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-08-26 10:10:41</published>
  <title>TypeScript でジェネリクスの部分的な型推論ができない</title>
  <type>rich</type>
  <url>https://hokaccha.hatenablog.com/entry/2020/08/26/101041</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
