Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Luau: Fixed panic when formatting explicit type instantiation (`f<<T>>()`) inside a nested function call argument (e.g. as a callback) ([#1088](https://github.com/JohnnyMorganz/StyLua/issues/1088))

## [2.4.0] - 2026-03-07

### Added
Expand Down
2 changes: 2 additions & 0 deletions src/formatters/trivia_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ fn is_expression_simple(expression: &Expression) -> bool {
},
other => unreachable!("unknown node: {:?}", other),
},
#[cfg(feature = "luau")]
Suffix::TypeInstantiation(_) => true,
other => unreachable!("unknown node: {:?}", other),
})
}
Expand Down
4 changes: 4 additions & 0 deletions tests/inputs-luau/type-instantiation-in-callback.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Test for issue #1088: turbofish/TypeInstantiation inside nested function call
Charm.computed(function()
return createPluginSettingsStore<<AuthStore>>("PresenceAuthStore", defaultValue, validate)
end)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
source: tests/tests.rs
assertion_line: 36
expression: "format(&contents, LuaVersion::Luau)"
input_file: tests/inputs-luau/type-instantiation-in-callback.lua
---
-- Test for issue #1088: turbofish/TypeInstantiation inside nested function call
Charm.computed(function()
return createPluginSettingsStore<<AuthStore>>("PresenceAuthStore", defaultValue, validate)
end)

Loading