You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, all string values will be inferred as string, even if the literal value of the string is known
In the following example, it should be safe to assume the literal value of the string in multiple places
localfunctionfoo(bar: string)
ifbar=="Hello World" then--bar can be safely inferred as "Hello World"endreturnbarend--this is a really bad examplelocalfunctionstringAsGeneric<T>(str: T): Treturnstrendlocala=stringAsGeneric("Hello World") --> a should be inferred as "Hello World"localb="Hi"localc=stringAsGeneric(b) --> c should be inferred as the type of b which is "Hi"
If the value of the string cant be guaranteed, ie: RemoteEvent connection, it should fall back to string
I assume there is some technical reason for this not already being possible
The text was updated successfully, but these errors were encountered:
Currently, all string values will be inferred as
string
, even if the literal value of the string is knownIn the following example, it should be safe to assume the literal value of the string in multiple places
If the value of the string cant be guaranteed, ie: RemoteEvent connection, it should fall back to
string
I assume there is some technical reason for this not already being possible
The text was updated successfully, but these errors were encountered: