[SR-9032] Add ability to create ‘character' literals to compiler. #51535
Labels
compiler
The Swift compiler in itself
feature
A feature request or implementation
swift evolution proposal needed
Flag → feature: A feature that warrants a Swift evolution proposal
Additional Detail from JIRA
md5: 82dd26a9f4af318193363fdfc65d9a9d
Issue Description:
It is sometimes useful to be able to express the ascii value of a character more conveniently than the existing UInt8(ascii: “a”) and now that the syntax for raw strings has taken a different direction it is suggested this be simply ‘a’ as it is in many other languages. These would be Character literals in the Swift sense, able to express any UNICODE extended grapheme cluster but if the cluster contains only a single code point it should be possible to express Swift’s integer types using this literal syntax. As examples:
let a: Int8 = ‘a’
let newline: Int8 = ‘\n’
The text was updated successfully, but these errors were encountered: