Commit graph

59 commits

Author SHA1 Message Date
Arseny Kapoulkine
af64680a5e
Mark singleton types and unsealed table literals RFCs as implemented (#438) 2022-03-29 16:58:59 -07:00
Andy Friesen
75bccce3db
RFC: Lower Bounds Calculation (#388)
Co-authored-by: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com>
2022-03-29 12:37:14 -07:00
Arseny Kapoulkine
5e7e462104
Update STATUS.md 2022-03-24 13:10:56 -07:00
Arseny Kapoulkine
ab64a097cd
Mark sealed table subtyping RFC as implemented 2022-03-24 13:10:30 -07:00
Arseny Kapoulkine
b8e025311b
Mark table.clone as implemented 2022-03-24 09:29:20 -07:00
Arseny Kapoulkine
5a21c41363
Update STATUS.md 2022-03-24 09:26:42 -07:00
Alexander McCord
7ab76e582c
RFC: Do not implement non-nil postfix ! operator. (#420)
This is a meta-RFC. I'd like to propose to remove the postfix `!` operator from the language.

I'd like to argue that this operator will eventually become useless and can only be used incorrectly at some point in the future, and that there are likely ways for them to be sound without having to reach for the `!` hammer.

With that, I present these counterarguments:

Shortcoming <span>#</span>1: Refinements does not apply to the block after `return`/`break`/`continue`.

```lua
if not x or not y then return end
-- both x and y are truthy
```

This will be solved by implementing control flow analysis where it'd apply the inverse of the condition leading up to the control transfer statement to the rest of the scope.

Shortcoming <span>#</span>2: Type checker is not aware of the actual state of various locations.

```lua
type Foo = { x: { y: number }? }?
local foo: Foo = { x = { y = 5 } }
print(foo.x.y) -- prints 5 at runtime, type checker warns on this
```

This will be solved by implementing type states where it would inspect the initialization sites as well as assignments to know their actual states. That is, rather than trusting the type annotation `Foo` as the state which gets us far enough, we'd start seeing these type annotations as a subtype constraint for the location `foo`.

---

If there are other use cases not covered in this message, we should talk about that and see if there exists an alternative direction that can solve these use cases soundly.
2022-03-24 08:38:16 -07:00
Alexander McCord
2f15079642
Fold in rationale for making else branch mandatory in if-then-else expressions. (#426)
This has been discussed but just didn't get incorporated into the RFC.
2022-03-23 16:53:52 -07:00
Arseny Kapoulkine
898c0501d1
Update STATUS.md
Add table.clone
2022-02-28 14:16:35 -08:00
Arseny Kapoulkine
5e8242aeda
RFC: table.clone (#362) 2022-02-28 14:15:33 -08:00
Arseny Kapoulkine
3c42b3a013
Revert "Mark singleton types RFC as implemented (#370)" (#378)
This reverts commit 731e197757.
2022-02-19 10:57:29 -08:00
Alexander McCord
731e197757
Mark singleton types RFC as implemented (#370) 2022-02-17 16:16:31 -08:00
Arseny Kapoulkine
e49a0fd4cd
Mark default type parameters RFC as implemented (#369) 2022-02-17 16:14:35 -08:00
Arseny Kapoulkine
e541e19f44
Create RFC status tracking document (#363)
This tracks status of all unimplemented RFCs in one central place. Hopefully we won't forget to update this when new RFCs are added!
2022-02-15 18:37:02 -08:00
Arseny Kapoulkine
7d679b317f
RFC: Generalized iteration (#335)
Co-authored-by: dcope-rbx <91100513+dcope-rbx@users.noreply.github.com>
Co-authored-by: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com>
2022-02-14 10:04:07 -08:00
Arseny Kapoulkine
a23b467485
Add turbofish discussion to generic function RFC (#300) 2022-01-07 11:07:36 -08:00
Arseny Kapoulkine
287b46e6a7
Mark bidirectional ascription RFC as implemented (#305) 2022-01-07 11:07:22 -08:00
Arseny Kapoulkine
b5e338325b
Mark coroutine.close RFC as implemented (#304) 2022-01-07 08:52:33 -08:00
Alan Jeffrey
82587bef29
RFC: Fix an unsoundness issue around stripping optional properties (#276)
* Fix an unsoundness issue around stripping optional properties

Co-authored-by: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com>
2022-01-06 12:48:09 -06:00
boyned//Kampfkarren
5e7648947b
RFC: Safe navigation operator (#142)
Co-authored-by: Alexander McCord <11488393+alexmccord@users.noreply.github.com>
2021-12-20 15:38:15 -08:00
vegorov-rbx
71adace16e
RFC: Amend 'Default type alias type parameters' for type pack parameters (#238)
* Do not allow regular type assignment to a type pack as a default parameter

* With type pack support in type aliases, this second form with an empty list is now supported

* Update rfcs/syntax-default-type-alias-type-parameters.md

Co-authored-by: Alan Jeffrey <403333+asajeffrey@users.noreply.github.com>

* Update syntax-default-type-alias-type-parameters.md

Even more examples

Co-authored-by: Alan Jeffrey <403333+asajeffrey@users.noreply.github.com>
2021-12-08 04:21:47 -08:00
Arseny Kapoulkine
9488f2379d
Mark bit32.count* RFC as implemented 2021-12-03 11:10:41 -08:00
vegorov-rbx
6b2b179aa6
Mark 'Type alias type packs' RFC as implemented (#237) 2021-11-23 10:03:20 -08:00
Alexander McCord
6958716ccd
RFC: String interpolation (#165) 2021-11-22 14:59:38 -08:00
Arseny Kapoulkine
4265e58ad1
RFC: coroutine.close (#88) 2021-11-17 06:49:49 -08:00
Alan Jeffrey
59366ad7f8
Clarified parsing properties of tables in the presence of singleton types (#207) 2021-11-16 14:48:01 -06:00
Arseny Kapoulkine
70ffc8a01d
RFC: Do not allow method call on string literals (#145) 2021-11-12 06:54:00 -08:00
Arseny Kapoulkine
fe1bf43b54
RFC: bit32.countlz/countrz (#89)
Co-authored-by: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com>
2021-11-09 10:40:14 -08:00
Josh Soref
278e848cc2
Spelling (#119)
Fixed various spelling errors.

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2021-11-04 09:50:46 -05:00
Arseny Kapoulkine
1f0084daa3 Mark RFCs that were implemented as such. 2021-11-03 21:35:25 -07:00
Amber's Careware
eed3c8c38f
Update config-luaurc.md (#104)
When running `luau-analyze` with a .luarc that has a "mode" key, it outputs the following:
> .luaurc: Unknown key mode
I'm assuming it was named "mode" at first and was re-named "languageMode" later on?
2021-11-03 13:15:51 -07:00
Arseny Kapoulkine
05a41d5d54
Remove team restriction from RFC process documentation
Fixes #98
2021-11-03 12:13:42 -07:00
vegorov-rbx
0fd38fd765
RFC: Type alias type packs (#83) 2021-10-27 11:53:45 -07:00
Alan Jeffrey
59c0492419
RFC: Write-only properties (#79)
Co-authored-by: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com>
2021-10-27 11:42:17 -07:00
Alan Jeffrey
628d7d9fcd
RFC: Read-only properties (#77)
* Added rfcs/property-readonly.md

Co-authored-by: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com>
2021-10-11 09:58:01 -05:00
Arseny Kapoulkine
d42dba9c95
RFC: Configure analysis via .luaurc (#47) 2021-10-07 22:41:56 -07:00
Arseny Kapoulkine
c54a8c81f6
Update function-table-freeze.md
Fix typos and formatting
2021-10-07 17:51:08 -07:00
Alan Jeffrey
f8fb1016dc
RFC: Unsealed table assignment creates an optional property (#73)
* Added rfcs/unsealed-table-assign-optional-property.md

Co-authored-by: Lily Brown <lily@lily.fyi>
2021-10-05 19:22:38 -05:00
Alan Jeffrey
43b803b267
RFC: Recursive type restriction (#68)
Co-authored-by: Alan Jeffrey <403333+asajeffrey@users.noreply.github.com>
Co-authored-by: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com>
2021-09-27 10:49:03 -07:00
Arseny Kapoulkine
08bdb5b202
Rename syntax-type-ascription-2.md to syntax-type-ascription-bidi.md 2021-09-23 11:18:02 -07:00
Arseny Kapoulkine
1788de56a0
Update syntax-if-expression.md
Add a note that only one expression is evaluated in `if-expr`.
2021-09-22 14:08:37 -07:00
Andy Friesen
d35b2a65c9
RFC: Update type assertions to permit conversion between any two related types (#56)
Co-authored-by: Arseny Kapoulkine <arseny.kapoulkine@gmail.com>
2021-09-14 11:55:20 -07:00
vegorov-rbx
10a407226b
RFC: Default type alias type parameters (#61)
* RFC: Default type alias type parameters

* Update the motivating example to match actual motivating example

* Resolved review comments

* improved motivation for the feature and noted additional languages with this feature
* fixed terminology between 'argument' and 'parameter'
* brought back support for default type pack parameter values
* removed alternative syntax and described the decision between ':' and '=' in the design section
* fixed drawback text and provided an example

* Remove return type pack annotation from allowed type pack default values,type annotation syntax doesn't allow that to be stand-alone

* Generic type pack has to be referenced by generic type pack name (with ...)
2021-08-20 20:26:37 +03:00
Arseny Kapoulkine
7e71295c27
RFC: Deprecate getfenv/setfenv (#51) 2021-06-24 23:02:57 -07:00
vegorov-rbx
9a4487f3e9
RFC: nil-forgiving operator (#48)
Co-authored-by: Alexander McCord <11488393+alexmccord@users.noreply.github.com>
2021-06-23 12:58:00 -07:00
Arseny Kapoulkine
e8a58ea42f
Update if-expr RFC with mid-block return interaction (#43)
We don't have mid-block return support yet and it's not clear if we will due to similar grammatical issues with this wrt function calls, but noting this for completeness (thanks @alexmccord for bringing this up)
2021-06-01 15:45:43 -07:00
vegorov-rbx
7ab5a3a2db
Mark 'Named Function Type Arguments' status as implemented (#41) 2021-05-31 21:07:37 +03:00
Lily Brown
43d606fad4
RFC: Sealed table subtyping (#38) 2021-05-31 10:39:09 -07:00
Alexander McCord
cc399fa98d
RFC: Singleton types (#37)
Co-authored-by: Arseny Kapoulkine <arseny.kapoulkine@gmail.com>
2021-05-28 09:13:44 -07:00
Arseny Kapoulkine
d40107dc60
Add RFC status fields (#39)
It seems more consistent and unambiguous if we mark RFCs as being
implemented when the implementation lands instead of expecting to
cross-reference documentation. That also makes it easier for us to flag
stale RFCs.
2021-05-17 18:19:49 -07:00