Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-8354] Runtime warning on failure to demangle type #50882

Closed
ChristopherRogers opened this issue Jul 24, 2018 · 9 comments
Closed

[SR-8354] Runtime warning on failure to demangle type #50882

ChristopherRogers opened this issue Jul 24, 2018 · 9 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself runtime The Swift Runtime

Comments

@ChristopherRogers
Copy link
Contributor

Previous ID SR-8354
Radar rdar://problem/42546938
Original Reporter @ChristopherRogers
Type Bug
Status Resolved
Resolution Done
Environment

Swift 4.2 (Xcode 10 beta 4)
Swift 4.2-dev master branch (c2452cf)

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

md5: 95c81544b19c358f5ecb8e2fcc8f5d4f

is duplicated by:

  • SR-9444 Calling .makeIterator() on an Array results in runtime demangle warning
  • SR-8433 Runtime failure to demangle type for Codable property
  • SR-8593 Runtime: Unable to Demangle Type of Field
  • SR-9057 SWIFT RUNTIME BUG: unable to demangle type of field '_transform'
  • SR-9058 string indices demangling issue

Issue Description:

Running the following code will result in the output below.

let l = (0...40).lazy.filter({ _ in true })
Mirror(reflecting: l).children.forEach { print($0) }
(label: Optional("_base"), value: ClosedRange(0...40))
SWIFT RUNTIME BUG: unable to demangle type of field '_predicate'. mangled type name is 'Sb7ElementSTQzc'
(label: Optional("_predicate"), value: ())

This doesn't occur in Swift 4.1.2. The output there is:

(label: Optional("_base"), value: CountableClosedRange(0...40))
(label: Optional("_predicate"), value: (Function))
@belkadan
Copy link
Contributor

@jckarter, does this look familiar?

@jckarter
Copy link
Member

Haven't seen this one, looks like the runtime demangler is missing a case.

@jckarter
Copy link
Member

@swift-ci create

@DougGregor
Copy link
Member

This is fixed on master at 191db1e. Not sure if it was part of my recent refactoring.

@swift-ci
Copy link
Collaborator

Comment by David Kopec (JIRA)

Did this fix make it into the final version of Swift 4.2 that ships with Xcode 10? I am still seeing it in a Playground when the page "Chapter 3" of the Playground in this repository runs under the Mac App Store version of Xcode 10/Swift 4.2:

https://github.com/davecom/ClassicComputerScienceProblemsInSwift

This did not exist in Xcode 9/Swift 4.1.2.

Thanks.

@jckarter
Copy link
Member

It is not fixed in Swift 4.2, unfortunately, but the warning is harmless in most cases and can be ignored.

@swift-ci
Copy link
Collaborator

Comment by Ray Fix (JIRA)

I am glad it appears that a big refactoring appears to have solved it. If it is harmless and ignorable, could it be commented out on 4.2 so the message is not emitted? This would help improve playgrounds as a learning platform.

@swift-ci
Copy link
Collaborator

Comment by David Kopec (JIRA)

I have to agree with this. To a new user experiencing a Playground, this appears to be a serious error, when really it is harmless. It would be optimal to get a fix sooner rather than later. Thanks.

@jckarter
Copy link
Member

Yes, I disabled the message in playgrounds (and made the warnings more descriptive) in this PR: #19416

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself runtime The Swift Runtime
Projects
None yet
Development

No branches or pull requests

5 participants