swift icon indicating copy to clipboard operation
swift copied to clipboard

[SR-2452] Mistaken reference to `.dynamicType` in debugger

Open jadengeller opened this issue 10 years ago • 2 comments

Previous ID SR-2452
Radar None
Original Reporter @jadengeller
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Xcode 8 beta 6, swift 3

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: 6b2a018133e25aaf75a24fdc01096d1c

Issue Description:

When you use `.class`, the debugger suggests using `.dynamicType` even though this was replaced with `type(of:)`.

jadengeller avatar Aug 22 '16 20:08 jadengeller

That looks like it's coming from us, somewhere.

belkadan avatar Aug 22 '16 22:08 belkadan

An SDK change got this one a while ago.

Welcome to Apple Swift version 4.0 (swiftlang-900.0.53 clang-900.0.29). Type :help for assistance.
  1> import Foundation
  2> let newObject : NSObject? = NSObject()
newObject: NSObject? = 0x0000000100400630
  3> newObject?.class
error: repl.swift:3:12: error: 'class()' is unavailable in Swift: use 'type(of:)' instead
newObject?.class

CodaFi avatar Jul 14 '17 22:07 CodaFi