swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.67k stars 10.38k forks source link

[SR-12915] Compiler crash when calling NSPasteboard method #55361

Open iby opened 4 years ago

iby commented 4 years ago
Previous ID SR-12915
Radar None
Original Reporter @iby
Type Bug
Environment Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 85f8d39e1923a1688060bc7d016460fc

Issue Description:

The following crashes Swift:

NSPasteboard().readObjects(forClasses: [URL.self])

The following doesn't:

NSPasteboard().readObjects(forClasses: [NSURL.self])

Might be related: SR-8149

typesanitizer commented 4 years ago

Can you try reproducing with a more recent compiler, such as a snapshot toolchain? https://swift.org/download/#snapshots

I tried compiling the following program with a master compiler @ 50c0534206481bb7eebe1b4639f590a7eb5c07c0 and it gave me a compiler error instead of a crash.

import AppKit
let _ = NSPasteboard().readObjects(forClasses: [URL.self])