Skip to content

[SR-11092] Disallow backticks for non keywords #53484

@keith

Description

@keith
Previous ID SR-11092
Radar None
Original Reporter @keith
Type Improvement
Environment

Xcode 11.0 beta 3 (11M362v)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement
Assignee None
Priority Medium

md5: 10cfae3f651a2aca53b85e1d6ea2fc9d

Issue Description:

Currently if you have this code:

let `foo` = 5
print(`foo`)

It runs fine:

% swift /tmp/foo.swift
5

I would expect this to produce a warning / error since "foo" isn't a keyword, and therefore the backticks aren't necessary.

This might be / have been an intentional allowance, but I found it surprising that you can wrap anything in them which implies to me when reading the code that it's wrapping a keyword.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions