I am writing a type to get the last element type of a tuple, see on type-challenges: https://github.com/type-challenges/type-challenges/blob/main/questions/00015-medium-last/README.md
And the IDE get the wrong type. When I hover to the variable, it shows never type. It's completely wrong and it makes me very confuse.
type arr = ['a', 'c']
type Last<T> = T extends [...any, infer L] ? L : never
type tail = Last<arr1> // it should be 'c', but it give never
// But when I assign the type to a variable, it works
const a: tail = 'c' // Hover to a, the type is 'c', correct.
I try it on typescript Playground, and vscode, it all work. Only Webstorm got the wrong answer. Similar questions appear many times. And I close webstorm and restart it, it doesn't work as the same.
Is there a issue for that?