Skip to content

Commit 4692ace

Browse files
committed
Add a test case that exercises opaque existential box's value witness assignWith
rdar://31955457
1 parent d8be7ae commit 4692ace

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/Interpreter/dictOfAny.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// RUN: %target-run-simple-swift | %FileCheck %s
2+
// REQUIRES: executable_test
3+
// REQUIRES: objc_interop
4+
5+
import Foundation
6+
7+
var dict: [String: Any] = ["foo": 0x11111111 as NSNumber]
8+
print(dict) // succeeds
9+
// CHECK: ["foo": 286331153]
10+
dict["foo"] = 0x22222222
11+
print(dict) // used to crash
12+
// CHECK: ["foo": 572662306]

0 commit comments

Comments
 (0)