Python version (& distribution if applicable, e.g. Anaconda): 3.8.10
numpy version: 1.22.4
Issue description
Send np.ndarray type parameters to the np.cross() function can cause the unreachable code after the np.cross()function.
Code Snippet
import numpy as np
# Send np.ndarray type to the np.cross() function can cause the [unreachable code] after the np.cross() function.
x: np.ndarray = np.array([1, 2, 3])
y: np.ndarray = np.array([4, 5, 6])
# Correct behaviour after np.cross function.
# x = [1, 2, 3]
# y = [4, 5, 6]
res = np.cross(x, y)
# The code below is all unreachable!
print("Some code should be executed.")
print("Some code should be executed.")
print("Some code should be executed.")
print("Some code should be executed.")
print("Some code should be executed.")
Repro Steps
Just paste code to vscode.
Expected behavior
The code after np.cross() function should not be gray colored and get [unreachable code] warning.
Actual behavior
The code block after np.cross() function can be reached when execution. However, Pylance color them with [unreachable code color]
Environment data
Issue description
Send
np.ndarray
type parameters to thenp.cross()
function can cause theunreachable code
after thenp.cross()
function.Code Snippet
Repro Steps
Just paste code to vscode.
Expected behavior
The code after np.cross() function should not be gray colored and get [unreachable code] warning.
Actual behavior
The code block after np.cross() function can be reached when execution. However, Pylance color them with [unreachable code color]
Logs