mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Backticks in type annotations are nonsensical for now.
This commit is contained in:
parent
8dd6049fcb
commit
5ec039fa51
1 changed files with 7 additions and 0 deletions
|
@ -132,6 +132,13 @@ print(string.format("%* %* %*", return_two_nils()))
|
|||
--> error: value #3 is missing, got 2
|
||||
```
|
||||
|
||||
It must be said that we are not allowing this style of string literals in type annotations at this time, regardless of zero or many interpolating expressions, so the following two type annotations below are illegal syntax:
|
||||
|
||||
```lua
|
||||
local foo: `foo`
|
||||
local bar: `bar{baz}`
|
||||
```
|
||||
|
||||
## Drawbacks
|
||||
|
||||
If we want to use backticks for other purposes, it may introduce some potential ambiguity. One option to solve that is to only ever produce string interpolation tokens from the context of an expression. This is messy but doable because the parser and the lexer are already implemented to work in tandem. The other option is to pick a different delimiter syntax to keep backticks available for use in the future.
|
||||
|
|
Loading…
Add table
Reference in a new issue