Skip to content

Conversation

@jeparlefrancais
Copy link
Contributor

@jeparlefrancais jeparlefrancais commented Dec 24, 2025

Closes #261

This PR adds support for Luau type functions 🎉

More info about type functions: https://luau.org/typecheck/type-functions

  • update bundler to handle exported type functions
  • add entry to the changelog

@github-actions
Copy link

github-actions bot commented Jan 2, 2026

Coverage after merging type-function-statement into main will be

87.34%

Coverage Report for Changed Files
FileStmtsBranchesFuncsLinesUncovered Lines
src
   ast_converter.rs88.65%100%91.15%88.52%1043, 1067, 1087–1089, 1110, 1125–1127, 1175, 1179–1182, 1215, 1235, 1250, 1275, 1313, 1332–1334, 1379, 1413, 1428, 1444–1446, 1456, 1461–1463, 1478–1479, 1498, 1645–1647, 1708–1710, 1761–1763, 1787–1788, 1825–1827, 1855–1857, 1861–1863, 1926–1928, 1953–1955, 1962–1964, 1982–1984, 2008–2010, 2080, 2085–2087, 2107, 2113–2115, 2120–2122, 2147–2149, 2169, 218–220, 2226–2228, 2252–2255, 2285–2287, 2293–2295, 2298–2300, 235–236, 2362–2364, 237, 2376–2378, 2382–2384, 2398–2399, 2405–2406, 2420–2421, 2449, 2532–2534, 2562–2564, 2585–2587, 2617–2620, 2635–2636, 2639, 265–266, 2663–2665, 267, 2677–2679, 2699–2701, 2756–2758, 2790, 3133–3140, 3142–3143, 3145–3147, 3151–3162, 3171, 3173–3176, 3180–3183, 3188, 3214–3216, 3227–3229, 3247–3249, 488–490, 494–496, 543, 604, 619–621, 656–659, 666, 680, 695–697, 701–703, 718–721, 724, 733–735, 776–777, 787–789, 795–797, 840, 862, 957, 961–963, 984
   parser.rs88.55%100%94.12%87.72%23–24, 31–32, 568–570, 573, 73–77, 89
src/generator
   dense.rs88.07%100%93.41%87.54%1012–1019, 1045–1051, 1065–1067, 1085–1089, 1097, 1106–1107, 1112, 1118, 1127–1135, 1152, 1174, 1187–1190, 1194–1197, 159–160, 162, 176–177, 179, 253–265, 267–273, 275–276, 287–289, 368, 417, 50, 507, 51–53, 55, 57–59, 61, 614–616, 62–63, 65, 650, 66–67, 671, 68–69, 721, 740, 80, 923, 968, 985
   mod.rs98.65%100%100%98.54%391, 407, 411
   readable.rs97.24%100%99.04%97.07%1163, 1214–1218, 1270, 1323–1325, 1392, 1419, 1449, 182, 187–188, 192, 205–206, 211, 216, 234–235, 415, 48, 50–53, 55, 657–658
   token_based.rs93.12%100%94.53%92.98%1003–1004, 1011, 1026, 1031–1035, 1054–1055, 1068–1069, 1090–1091, 1105–1107, 1130–1131, 1140–1142, 1161–1162, 1171–1173, 1224–1229, 1383, 139–140, 1480, 1517–1525, 156–157, 1636–1638, 1670–1679, 169–170, 1723, 1781, 191–192, 212–214, 2248–2249, 2308–2312, 2532, 2536, 254, 2549, 306–310, 380–381, 387, 399, 459–460, 482–483, 499–500, 542, 630–631, 664–665, 699–700, 762–763, 804–805, 853–857, 874, 89, 920–922, 993–994
src/nodes
   function_body.rs100%100%100%100%
src/nodes/statements
   mod.rs92.39%100%100%90.79%102–103, 93, 95–98
   type_function.rs86.27%100%84.09%86.77%132–135, 148–150, 188–192, 195–197, 245–247, 255, 76–80
src/process
   node_processor.rs97%100%96.94%97.06%108, 44, 67
   post_visitor.rs94.64%100%98.36%94.23%146–147, 149–152, 164–166, 169, 173, 220–222, 225, 229, 247–249, 279–281, 293–295, 298, 302, 330, 337, 89–91
   visitors.rs100%100%100%100%
src/rules
   filter_early_return.rs96.72%100%100%96.08%22–23
   remove_comments.rs94.51%100%91.50%95.49%297, 341, 422, 499–501
   remove_spaces.rs99.21%100%100%98.99%253
   remove_types.rs100%100%100%100%
   replace_referenced_tokens.rs96.15%100%96.49%96.06%171–173, 182, 258–261
   shift_token_line.rs95.85%100%96.30%95.72%171–173, 268–271, 95
src/rules/bundle
   rename_type_declaration.rs98.34%100%100%98.09%175–176, 80
src/utils
   lines.rs77.78%100%92.86%75.89%107, 111, 117–118, 126, 182–193, 195–196, 198–201, 206, 214, 222–226, 228, 230–238, 240, 272, 274, 64–65

@jeparlefrancais jeparlefrancais merged commit 7050f5c into main Jan 2, 2026
6 checks passed
@jeparlefrancais jeparlefrancais deleted the type-function-statement branch January 2, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support type functions

2 participants