Skip to content

Commit 2918f1a

Browse files
authored
Merge pull request #2964 from swiftlang/mracek/section-control-no-strings
Update 0492-section-control.md to avoid using a String in the example
2 parents b97e458 + 10daeac commit 2918f1a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

proposals/0492-section-control.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,13 @@ let myLinkerSetEntry: Int = Int.random(in: 0 ..< 10) // ❌ error
7575
@section("__DATA,mysection")
7676
var mutableVariable: Int = 42 //
7777

78-
// Some complex data types are allowed (static strings, functions)
79-
typealias PluginData = (version: Int, name: String, initializer: @convention(c) ()->())
78+
// Some complex data types are allowed (tuples, function references)
79+
typealias PluginData = (version: Int, identifier: UInt64, initializer: @convention(c) ()->())
8080

8181
@section("__DATA,plugins")
8282
@used
8383
let myPlugin: PluginData = (
8484
version: 1,
85-
name: "MyPlugin",
8685
initializer: { print("init") }
8786
)
8887
```

0 commit comments

Comments
 (0)