Commit Graph
4372 Commits
Author SHA1 Message Date
Dan Vanderkam 3ab6faef39 Drop isTriviallyNonBoolean, switch to simpler test, check for assertions 2024-02-25 19:08:00 -05:00
Dan Vanderkam 52df1158d9 Add test case for a predicate that throws 2024-02-23 11:15:04 -05:00
Dan Vanderkam a72b1f1743 add prisma circularity test with failing baseline 2024-02-23 10:50:48 -05:00
Dan Vanderkam 101df932d5 Add secondary subtype check and tests 2024-02-21 16:16:15 -05:00
Dan Vanderkam 0c24ccc049 Infer type predicates from function bodies 2024-02-20 17:32:46 -05:00
Anders Hejlsberg d04e3489b0 Improve apparent type of mapped types (#57122) 2024-02-18 14:46:37 -10:00
Mateusz Burzyński feb57c269b Instantiate earlier inferred constraints in conditional types (#57362) 2024-02-16 14:31:28 -08:00
Mateusz Burzyński 29c0024bcf Avoid creating rest elements with errorType when any is spread (#57116) 2024-02-16 14:05:33 -08:00
Gabriela Araujo Britto a6414052a3 Allow (non-assert) type predicates to narrow by discriminant (#57358) 2024-02-13 11:33:30 -08:00
Mateusz Burzyński 0b4966ab2a Fixed type parameter leak in union calls with mixed type parameter presence (#57371) 2024-02-12 15:07:05 -08:00
Mateusz Burzyński e2bf8b437d Fixed distributive conditional types with never intersections (#57345) 2024-02-09 12:25:02 -08:00
Jan Kühle bcef7eba53 Always emit Object type in decorator metadata for import type (#56594) 2024-02-05 16:40:50 -05:00
Jake Bailey db823e3681 Add test for issue 54655 (#57275) 2024-02-02 10:39:56 -08:00
Mateusz Burzyński 1445bd4344 Reissue used before declaration error for const enums in isolatedModules (#57174) 2024-01-30 08:35:59 -08:00
Nathan Shively-Sanders 584b314c4c Revert #54477 but keep the tests (#57160) 2024-01-24 16:29:45 -08:00
Andrew Branch 94f4379bca Fix isolatedModules check for export assignments (#57148) 2024-01-24 12:03:18 -08:00
Andrew Branch 25a4f9e535 Deprioritize declaration emit paths from baseUrl containing node_modules (#57145) 2024-01-23 13:31:15 -08:00
Gabriela Araujo Britto 0a2b0bbb4b No number constraint to mapped type with as clause (#57093) 2024-01-19 14:36:51 -08:00
Andrew Branch 6cb6fc94ae Add --module preserve, support require in --moduleResolution bundler (#56785) 2024-01-19 12:03:24 -08:00
Gabriela Araujo Britto 4a34f45099 Revert "Fixed apparent type of homomorphic mapped type with non-homomorphic instantiation (#56727)" and add test (#57092) 2024-01-19 10:25:54 -08:00
Jake Bailey ad2f465a38 Detect binary files by checking first 256 code units for 0xFFFD (#57008) 2024-01-16 16:15:23 -08:00
Gabriela Araujo Britto 59b6f78c29 Revert "Add numeric constraint to type parameter of mapped types with… (#57076) 2024-01-16 13:02:54 -08:00
Mateusz Burzyński 3f8707d04f Add numeric constraint to type parameter of mapped types with name type and array constraints (#55774) 2024-01-16 10:59:00 -08:00
Titian Cernicova-Dragomir fea4a4544f Do not remove binding alias in function declarations (#57020) 2024-01-12 11:23:22 -08:00
fbf908bd58 Add types for Object.groupBy() and Map.groupBy() (#56805)
Co-authored-by: Nick McCurdy <nick@nickmccurdy.com>
Co-authored-by: Karl Horky <karl.horky@gmail.com>
Co-authored-by: Niklas Mollenhauer <nikeee@outlook.com>
2024-01-11 11:17:54 -08:00
Mateusz Burzyński e76972562d Fxied declaration emit for JS files when module.exports is assigned a non-alias value and when it has extra type members (#56243) 2024-01-11 10:31:11 -08:00
Andrew Branch 385db449f5 With allowJs, process JS files found searching node_modules when they have a realpath outside node_modules (#56946) 2024-01-10 10:15:58 -08:00
Mateusz Burzyński 4bcbc16cff Use symbols of type aliases when emitting declarations (#56087) 2024-01-09 13:02:52 -08:00
Mateusz Burzyński 4557e34e70 Emit declarations using alternative containing modules for types exported using separate export statements (#56857) 2024-01-09 11:34:49 -08:00
Wesley Wigham bc74ec41a3 When relating a deferred index type over a mapped type on the source side ... (#56742) 2024-01-09 11:28:02 -08:00
Mateusz Burzyński 3b1db10290 Fixed an issue with write type being left as non-instantiated when coming from a merged instantiation (#56322) 2024-01-09 11:21:50 -08:00
Mateusz Burzyński 424b96475e Fixed apparent type of homomorphic mapped type with non-homomorphic instantiation (#56727) 2024-01-09 11:13:50 -08:00
Mateusz Burzyński 1e00399a38 Fixed emit of return statements with parenthesized assertions and comments (#56601) 2024-01-09 11:10:15 -08:00
Anders Hejlsberg 8ff77fbc48 Preserve type refinements in closures created past last assignment (#56908) 2024-01-08 20:21:05 -08:00
Mateusz Burzyński 5a355093bb Fixed narrowing based on aliased discriminants coming from destructured parameters (#56860) 2024-01-08 13:18:06 -08:00
Andrew Branch a099275b2a Fix declaration emit for JS default re-exports that resolve to modules through synthesized default exports (#56340) 2024-01-03 13:46:54 -08:00
Gabriela Araujo Britto be20dbbbbb Infer between generic mapped types before inferring from apparent type (#56640) 2024-01-02 15:35:10 -08:00
Oleksandr T 382de91763 fix(56737): unique symbol quick info is different in JS than TS (#56743) 2024-01-02 11:34:45 -08:00
Kagami Sascha Rosylight 8a3fe5760f Add asynciterable libs (#56723) 2024-01-02 11:07:57 -08:00
Daniel Rosenwasser 93e6b9da0c Enforce identical enum values in compatibility checks (#55924) 2023-12-20 13:52:11 -08:00
Mateusz Burzyński 2c7162143b Treat array literal contextually typed by homomorphic mapped types as in tuple context (#56555) 2023-12-13 15:12:38 -08:00
Titian Cernicova-DragomirandJake Bailey b527b9059a Perform usage analysis on refenced binding aliases in function signatures. (#55683)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
2023-12-13 13:14:51 -08:00
Jan Kühle ba9eddb0d1 isolatedModules error on global shadowed by imported type (#56732) 2023-12-13 10:32:59 -08:00
Andrew Branch 289344a1ec Don’t emit file references that are already referenced via imports (#56614) 2023-12-11 16:35:36 -08:00
Mateusz Burzyński af368780cd Avoid dependent parameters narrowings if any declared symbol of the parameter is assigned to (#56313) 2023-12-11 13:42:30 -08:00
Josh Goldberg ✨ 41259d537b Allow variance annotations on generic references (#56418) 2023-12-11 11:22:01 -08:00
Mateusz Burzyński 5b10466b63 Prevent ObjectFlags.IdenticalBaseTypeExists and ObjectFlags.IsConstrainedTypeVariable confusion (#56711) 2023-12-11 10:24:32 -08:00
Mateusz BurzyńskiandJake Bailey 41ec497211 Defer conditional types with parenthesized multi-element tuple types in extends clause (#56271)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
2023-12-08 12:21:04 -08:00
Ryan Cavanaugh 8456dccbda Directly copy only the index signature in addition to declared properties (#56626) 2023-12-07 12:25:50 -08:00
Oleksandr TandNathan Shively-Sanders 7e1c297730 fix(53181): Overloads Are Not Generated as Expected When Using JsDocOverload Tag to Declare Overloads of Functions Assigned to a Prototype (#53317)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2023-12-06 06:27:27 -08:00