Skip to content

[SR-2404] Swift silently doesn't use -D flag if you assign a value to it (e.g. -DDEBUG=1) #45011

@belkadan

Description

@belkadan
Previous ID SR-2404
Radar rdar://problem/22157790
Original Reporter @belkadan
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, StarterBug
Assignee @CodaFi
Priority Medium

md5: a01133e8f636613e7b7012a9ceb819d8

Issue Description:

If people use non-identifier -D flags with Swift assuming that it works the same as C, the compiler just throws that away. (Actually, it's probably dutifully adding a custom condition that just can't ever be typed.) We should produce an error on a non-identifier -D flag (as determined by Lexer::isIdentifier), possibly with special cases for =.

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfgood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions