ITADN

`preprocessclass` error

#1410ClosedxLuigiGamerx 创建于 2026-01-07
bug
X
xLuigiGamerxcommented
Trying to type hint specifically `function` seems to cause an error in classes, this doesn't happen if you use a type defined to `function`, something like this will cause an error ```lua class smth function __construct(func : function) end func : function end ``` error: ``` index.pluto:2: warning: unused local variable [unused] 2 | function __construct(func : function) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ here: 'func' is unused syntax error: index.pluto:5: internal error: 'preprocessclass' failed to handle a block 5 | end | ^^^ here + note: Report this at: https://github.com/PlutoLang/Pluto/issues ``` but this works without error: ```lua $type func = function class smth function __construct(func : func) end func : func end ```
关闭于 2026-01-08 0 条评论