luau/Analysis/src
JohnnyMorganz e8c0550586
Improve the type for `os.date` using overloads (#874)
Improves the type of `os.date` based on its documentation
https://create.roblox.com/docs/reference/engine/libraries/os#date

We know that the DateTypeResult table is only returned when the format
string is either "*t" or "!*t", and otherwise its just a formatted
string. This changes the type to showcase this appropriately.

I put the more strict type first in the overload because the ordering
makes a difference

Note: the API docs used in studio
(https://github.com/MaximumADHD/Roblox-Client-Tracker/blob/roblox/api-docs/en-us.json)
may need to be updated to reflect the overloaded type instead.


![image](https://user-images.githubusercontent.com/19635171/226919224-e9e8703b-2729-44b0-93f6-434c01bda204.png)

It may be possible to add a lint of this too to provide analysis similar
to how `string.format` works with a FormatString error. Will leave that
for a different PR though
2023-05-01 08:09:05 -07:00
..
Anyification.cpp Attach definition location to `TableType` (#801) 2023-01-12 06:21:25 -08:00
ApplyTypeFunction.cpp Sync to upstream/release/557 (#794) 2023-01-04 12:53:17 -08:00
AstJsonEncoder.cpp Add prefix and name location to AstTypeReference (#902) 2023-04-17 07:19:56 -07:00
AstQuery.cpp Sync to upstream/release/574 (#910) 2023-04-28 12:55:13 -07:00
Autocomplete.cpp Sync to upstream/release/574 (#910) 2023-04-28 12:55:13 -07:00
BuiltinDefinitions.cpp Sync to upstream/release/574 (#910) 2023-04-28 12:55:13 -07:00
Clone.cpp Sync to upstream/release/574 (#910) 2023-04-28 12:55:13 -07:00
Config.cpp Sync to upstream/release/547 (#690) 2022-09-29 15:23:10 -07:00
Constraint.cpp Sync to upstream/release/543 (#657) 2022-09-01 16:14:03 -07:00
ConstraintGraphBuilder.cpp Sync to upstream/release/574 (#910) 2023-04-28 12:55:13 -07:00
ConstraintSolver.cpp Sync to upstream/release/574 (#910) 2023-04-28 12:55:13 -07:00
DataFlowGraph.cpp Sync to upstream/release/566 (#853) 2023-03-03 12:21:14 -08:00
DcrLogger.cpp Sync to upstream/release/565 (#845) 2023-02-24 13:49:38 -08:00
Def.cpp Sync to upstream/release/566 (#853) 2023-03-03 12:21:14 -08:00
EmbeddedBuiltinDefinitions.cpp Improve the type for `os.date` using overloads (#874) 2023-05-01 08:09:05 -07:00
Error.cpp Sync to upstream/release/573 (#903) 2023-04-21 15:14:26 -07:00
Frontend.cpp Sync to upstream/release/574 (#910) 2023-04-28 12:55:13 -07:00
Instantiation.cpp Sync to upstream/release/569 (#878) 2023-03-24 11:03:04 -07:00
IostreamHelpers.cpp Sync to upstream/release/557 (#794) 2023-01-04 12:53:17 -08:00
JsonEmitter.cpp Sync to upstream/release/543 (#657) 2022-09-01 16:14:03 -07:00
LValue.cpp Sync to upstream/release/527 (#491) 2022-05-19 17:02:24 -07:00
Linter.cpp Sync to upstream/release/570 (#885) 2023-03-31 11:42:49 -07:00
Module.cpp Sync to upstream/release/572 (#899) 2023-04-14 11:06:22 -07:00
Normalize.cpp Sync to upstream/release/574 (#910) 2023-04-28 12:55:13 -07:00
Quantify.cpp Sync to upstream/release/574 (#910) 2023-04-28 12:55:13 -07:00
Refinement.cpp Sync to upstream/release/566 (#853) 2023-03-03 12:21:14 -08:00
RequireTracer.cpp Sync to upstream/release/532 (#545) 2022-06-16 18:05:14 -07:00
Scope.cpp Sync to upstream/release/570 (#885) 2023-03-31 11:42:49 -07:00
Substitution.cpp Sync to upstream/release/574 (#910) 2023-04-28 12:55:13 -07:00
Symbol.cpp Sync to upstream/release/501 (#20) 2021-11-01 14:52:34 -07:00
ToDot.cpp Sync to upstream/release/574 (#910) 2023-04-28 12:55:13 -07:00
ToString.cpp Sync to upstream/release/574 (#910) 2023-04-28 12:55:13 -07:00
TopoSortStatements.cpp Sync to upstream/release/555 (#768) 2022-12-02 10:09:59 -08:00
Transpiler.cpp String interpolation (#614) 2022-08-24 12:01:00 -07:00
TxnLog.cpp Sync to upstream/release/567 (#860) 2023-03-10 12:21:07 -08:00
Type.cpp Sync to upstream/release/574 (#910) 2023-04-28 12:55:13 -07:00
TypeArena.cpp Sync to upstream/release/557 (#794) 2023-01-04 12:53:17 -08:00
TypeAttach.cpp Sync to upstream/release/574 (#910) 2023-04-28 12:55:13 -07:00
TypeChecker2.cpp Sync to upstream/release/574 (#910) 2023-04-28 12:55:13 -07:00
TypeInfer.cpp Sync to upstream/release/574 (#910) 2023-04-28 12:55:13 -07:00
TypePack.cpp Sync to upstream/release/571 (#895) 2023-04-07 14:01:29 -07:00
TypeReduction.cpp Sync to upstream/release/574 (#910) 2023-04-28 12:55:13 -07:00
TypeUtils.cpp Sync to upstream/release/574 (#910) 2023-04-28 12:55:13 -07:00
TypedAllocator.cpp Sync to upstream/release/555 (#768) 2022-12-02 10:09:59 -08:00
Unifiable.cpp Sync to upstream/release/571 (#895) 2023-04-07 14:01:29 -07:00
Unifier.cpp Sync to upstream/release/574 (#910) 2023-04-28 12:55:13 -07:00