Files
swift-mirror/test/ClangImporter/enum-renames.swift
Doug Gregor 7e30d54deb [Clang importer] Map imported names via the user-facing name
Swift names provided via C attributes or API notes can be parsed as
special names, such as `init` or `subscript`. However, doing so would
cause the Clang importer to crash, because it assumes that these names
are always identifiers. In these places, we actually want to treat
them as identifiers, where special names are mapped back to their
keywords. Introduce a function to do that, and use it consistently.
2023-12-12 14:22:02 -08:00

9 lines
235 B
Swift

// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck %s -verify
import enums_using_attributes
func testEvent(event: Event) {
if event == .`init` { print("Initialize") }
if event == .reset { print("Reset") }
}