Skip to content

Commit 92c18b7

Browse files
kostiakovallattner
authored andcommitted
Update 0139-bridge-nsnumber-and-nsvalue.md (#543)
fix code snipper to latest Swift syntax, without NS prefix
1 parent 1ab0b26 commit 92c18b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

proposals/0139-bridge-nsnumber-and-nsvalue.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ as `NSNumber`, other-sized numeric types fall back to opaque boxing:
2929
let i = 17
3030
let plist = ["seventeen": i]
3131
// OK
32-
try! NSJSONSerialization.data(withJSONObject: plist)
32+
try! JSONSerialization.data(withJSONObject: plist)
3333

3434
let j: UInt8 = 38
3535
let brokenPlist = ["thirty-eight": j]
3636
// Will throw because `j` didn't bridge to a JSON type
37-
try! NSJSONSerialization.data(withJSONObject: brokenPlist)
37+
try! JSONSerialization.data(withJSONObject: brokenPlist)
3838
```
3939

4040
We had shied away from enabling this bridging for all numeric types in

0 commit comments

Comments
 (0)