<h3 dir="auto">Describe the issue:</h3>
<p dir="auto">Running</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="pyright foo.py"><pre class="notranslate"><code class="notranslate">pyright foo.py
</code></pre></div>
<p dir="auto">on</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np


def myfun(x: np.ndarray, b: np.ndarray):
    v = b - x
    v.copy()"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>


<span class="pl-k">def</span> <span class="pl-en">myfun</span>(<span class="pl-s1">x</span>: <span class="pl-s1">np</span>.<span class="pl-s1">ndarray</span>, <span class="pl-s1">b</span>: <span class="pl-s1">np</span>.<span class="pl-s1">ndarray</span>):
    <span class="pl-s1">v</span> <span class="pl-c1">=</span> <span class="pl-s1">b</span> <span class="pl-c1">-</span> <span class="pl-s1">x</span>
    <span class="pl-s1">v</span>.<span class="pl-en">copy</span>()</pre></div>
<p dir="auto">gives</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  /tmp/dummy.py:6:7 - error: Cannot access member &quot;copy&quot; for type &quot;NoReturn&quot;
    Member &quot;copy&quot; is unknown (reportGeneralTypeIssues)"><pre class="notranslate"><code class="notranslate">  /tmp/dummy.py:6:7 - error: Cannot access member "copy" for type "NoReturn"
    Member "copy" is unknown (reportGeneralTypeIssues)
</code></pre></div>
<p dir="auto">The vector operations <code class="notranslate">+</code>, <code class="notranslate">*</code>, <code class="notranslate">/</code> work fine.</p>
<h3 dir="auto">NumPy/Python version information:</h3>
<p dir="auto">1.21.3 3.9.7 (default, Sep 10 2021, 14:59:43)<br>
[GCC 11.2.0]</p>
<h3 dir="auto">Describe the issue:</h3>
<p dir="auto">A operation between a <code class="notranslate">NDArray[Any]</code> array and an integer, as in the code example, makes Mypy infer the result as<br>
<code class="notranslate">numpy.ndarray[Any, numpy.dtype[numpy.signedinteger[Any]]]</code>. This is an error, as the result could also be a floating point array, or even a complex one.</p>
<h3 dir="auto">Reproduce the code example:</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from numpy.typing import NDArray

def f(arr: NDArray[Any]) -&gt; None:
    reveal_type(arr + 2)"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">numpy</span>.<span class="pl-s1">typing</span> <span class="pl-k">import</span> <span class="pl-v">NDArray</span>

<span class="pl-k">def</span> <span class="pl-en">f</span>(<span class="pl-s1">arr</span>: <span class="pl-v">NDArray</span>[<span class="pl-v">Any</span>]) <span class="pl-c1">-&gt;</span> <span class="pl-c1">None</span>:
    <span class="pl-en">reveal_type</span>(<span class="pl-s1">arr</span> <span class="pl-c1">+</span> <span class="pl-c1">2</span>)</pre></div>
<h3 dir="auto">Error message:</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">NumPy/Python version information:</h3>
<p dir="auto">1.21.2 3.7.6 (default, Jan  8 2020, 19:59:22)<br>
[GCC 7.3.0]</p>