[Luau] Explicit type parameter instantiation syntax is not supported
It seems that attempting to use [explicit type parameter instantiation syntax](https://rfcs.luau.org/explicit-type-parameter-instantiation.html) (or "turbofish"), which has been implemented for a little while now, causes StyLua to throw an error.
Example Luau code:
```luau
-- test.luau
local function f<T>(x: T)
return x
end
local a = f<<number?>>(nil)
```
Stylua command:
```powershell
stylua .\test.luau --syntax Luau
```
Error output:
```
error: could not format file .\test.luau: error parsing:
- unexpected token `<` (6:12 to 6:13), expected expression after binary operator
- unexpected token `<` (6:13 to 6:14), unexpected token, this needs to be a statement
- unexpected token `?` (6:20 to 6:21), unexpected expression when looking for a statement
- unexpected token `?` (6:20 to 6:21), unexpected token, this needs to be a statement
- unexpected token `` (6:28 to 6:28), unexpected expression when looking for a statement
```
关闭于 2026-02-28 1 条评论