<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong><br>
Some <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-3-4/#const-assertions" rel="nofollow">const assertions</a> result in errors. Seems like the check introduced in <a href="https://github.com/babel/babel/pull/9534/files#diff-be80f98b2faf4a89409f44cabdf86e5dR357">this PR</a> is too strict? Because I didn't see any errors in VSCode till I started webpack dev server.</p>
<p dir="auto"><strong>Input Code</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function foo() {
  const a = getObjectAWithLongAssType();
  const b = getObjectBWithLongAssType();

  return [a, b] as const; // no errors in tsc or vscode
  // Previously: return [a,b] as [typeof a, typeof b]
}"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-k">const</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-en">getObjectAWithLongAssType</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">const</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-en">getObjectBWithLongAssType</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

  <span class="pl-k">return</span> <span class="pl-kos">[</span><span class="pl-s1">a</span><span class="pl-kos">,</span> <span class="pl-s1">b</span><span class="pl-kos">]</span> <span class="pl-s1">as</span> <span class="pl-k">const</span><span class="pl-kos">;</span> <span class="pl-c">// no errors in tsc or vscode</span>
  <span class="pl-c">// Previously: return [a,b] as [typeof a, typeof b]</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Expected behavior/code</strong><br>
VSCode outputs the expected readonly tuple type, so I don't expect any errors in babel.</p>
<p dir="auto"><strong>Babel Configuration (.babelrc, package.json, cli command)</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    &quot;@babel/core&quot;: &quot;^7.4.0&quot;,
    &quot;@babel/plugin-proposal-class-properties&quot;: &quot;^7.4.0&quot;,
    &quot;@babel/polyfill&quot;: &quot;^7.4.0&quot;,
    &quot;@babel/preset-env&quot;: &quot;^7.4.2&quot;,
    &quot;@babel/preset-react&quot;: &quot;^7.0.0&quot;,
    &quot;@babel/preset-typescript&quot;: &quot;^7.3.3&quot;,"><pre class="notranslate"><code class="notranslate">    "@babel/core": "^7.4.0",
    "@babel/plugin-proposal-class-properties": "^7.4.0",
    "@babel/polyfill": "^7.4.0",
    "@babel/preset-env": "^7.4.2",
    "@babel/preset-react": "^7.0.0",
    "@babel/preset-typescript": "^7.3.3",
</code></pre></div>
<p dir="auto"><strong>Possible Solution</strong></p>

<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/tanhauhau/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/tanhauhau">@tanhauhau</a> is there a need for <code class="notranslate">tsCheckLiteralForConstantContext</code> to happen in babel? To me it seems like it's enough to parse <code class="notranslate">as const</code> expressions as assertions and move on, since TypeScript is actually in charge of ensuring the assertions are valid.</p>
<blockquote>
<p dir="auto">Issue originally made by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/s-panferov/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/s-panferov">@s-panferov</a></p>
</blockquote>
<h3 dir="auto">Bug information</h3>
<ul dir="auto">
<li><strong>Babel version:</strong> any</li>
<li><strong>Node version:</strong> &gt;= 4</li>
</ul>
<h3 dir="auto">Input code</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import * as crypto from 'crypto';"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">crypto</span> <span class="pl-k">from</span> <span class="pl-s">'crypto'</span><span class="pl-kos">;</span></pre></div>
<h3 dir="auto">Description</h3>
<p dir="auto"><code class="notranslate">_interopRequireWildcard</code> iterates through export object properties and this fires deprecation warning because of deprecated property access.</p>