mirror of
https://github.com/luau-lang/luau.git
synced 2025-04-04 10:50:54 +01:00
Update rfcs/syntax-type-ascription-2.md
This commit is contained in:
parent
1c1cb3c203
commit
9d7194099f
1 changed files with 1 additions and 1 deletions
|
@ -31,4 +31,4 @@ I propose that we change the meaning of the `::` operator to permit conversions
|
|||
|
||||
## Alternatives
|
||||
|
||||
We initially discussed allowing `::` to coerce anything to anything else, acting as a full bypass of the type system. We are not doing this because it is really just not that hard to implement: All we need to do is to succeed if unification works between the two types in either direction.
|
||||
We initially discussed allowing `::` to coerce anything to anything else, acting as a full bypass of the type system. We are not doing this because it is really just not that hard to implement: All we need to do is to succeed if unification works between the two types in either direction. Additionally, requiring one type to be subtype of another catches mistakes when two types are completely unrelated, e.g. casting a `string` to a table will still produce an error when this proposal is in effect - this will make sure that `::` is as safe of a bypass as it can be in practice.
|
||||
|
|
Loading…
Add table
Reference in a new issue