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-10572] "Failed to produce diagnostic for expression" #52972

Closed
macdrevx opened this issue Apr 28, 2019 · 5 comments
Closed

[SR-10572] "Failed to produce diagnostic for expression" #52972

macdrevx opened this issue Apr 28, 2019 · 5 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation failed to produce diagnostic Bug → internal error: Failed to produce diagnostic for expression type checker Area → compiler: Semantic analysis

Comments

@macdrevx
Copy link

Previous ID SR-10572
Radar rdar://problem/50347532
Original Reporter @macdrevx
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, TypeChecker
Assignee @macdrevx
Priority Medium

md5: 192d6cc96fa22dda718cd602c30a53c3

Issue Description:

Got a message asking me to file a bug report. Source code attached. I'm using Xcode Version 10.2.1 (10E1001) with Swift 5.

Build Log:

CompileSwift normal x86_64 /Users/andrew/Developer/GEOSwift/GEOSwift/GEOS/CoreTypes+GEOS.swift (in target: GEOSwift)`` cd /Users/andrew/Developer/GEOSwift`` /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/andrew/Developer/GEOSwift/GEOSwift/Codable/GeoJSONType.swift /Users/andrew/Developer/GEOSwift/GEOSwift/GEOS/WKB.swift /Users/andrew/Developer/GEOSwift/GEOSwift/GEOSwiftError.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Codable/Geometry+Codable.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Codable/MultiLineString+Codable.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Core\ Types/MultiLineString.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Codable/Feature+Codable.swift -primary-file /Users/andrew/Developer/GEOSwift/GEOSwift/GEOS/CoreTypes+GEOS.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Codable/Point+Codable.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Codable/JSON+Codable.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Codable/FeatureCollection+Codable.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Codable/GeoJSON+Codable.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Core\ Types/GeometryCollection.swift /Users/andrew/Developer/GEOSwift/GEOSwift/GEOS/GEOSError.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Core\ Types/MultiPoint.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Core\ Types/Geometry.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Core\ Types/JSON.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Core\ Types/GeoJSON.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Core\ Types/FeatureCollection.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Core\ Types/Feature.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Core\ Types/LineString.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Codable/GeometryCollection+Codable.swift /Users/andrew/Developer/GEOSwift/GEOSwift/GEOS/GEOSContext.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Codable/LineString+Codable.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Core\ Types/Point.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Codable/MultiPolygon+Codable.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Core\ Types/Polygon.swift /Users/andrew/Developer/GEOSwift/GEOSwift/GEOS/WKT.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Codable/MultiPoint+Codable.swift /Users/andrew/Developer/GEOSwift/GEOSwift/GEOS/GEOSGeometry.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Codable/Polygon+Codable.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Codable/CodableGeometry.swift /Users/andrew/Developer/GEOSwift/GEOSwift/Core\ Types/MultiPolygon.swift -emit-module-path /Users/andrew/Library/Developer/Xcode/DerivedData/GEOSwift-cmzccelinnedlbbaiqoswbevrzry/Build/Intermediates.noindex/GEOSwift.build/Debug-iphonesimulator/GEOSwift.build/Objects-normal/x86_64/CoreTypes+GEOS\~partial.swiftmodule -emit-module-doc-path /Users/andrew/Library/Developer/Xcode/DerivedData/GEOSwift-cmzccelinnedlbbaiqoswbevrzry/Build/Intermediates.noindex/GEOSwift.build/Debug-iphonesimulator/GEOSwift.build/Objects-normal/x86_64/CoreTypes+GEOS\~partial.swiftdoc -serialize-diagnostics-path /Users/andrew/Library/Developer/Xcode/DerivedData/GEOSwift-cmzccelinnedlbbaiqoswbevrzry/Build/Intermediates.noindex/GEOSwift.build/Debug-iphonesimulator/GEOSwift.build/Objects-normal/x86_64/CoreTypes+GEOS.dia -emit-dependencies-path /Users/andrew/Library/Developer/Xcode/DerivedData/GEOSwift-cmzccelinnedlbbaiqoswbevrzry/Build/Intermediates.noindex/GEOSwift.build/Debug-iphonesimulator/GEOSwift.build/Objects-normal/x86_64/CoreTypes+GEOS.d -emit-reference-dependencies-path /Users/andrew/Library/Developer/Xcode/DerivedData/GEOSwift-cmzccelinnedlbbaiqoswbevrzry/Build/Intermediates.noindex/GEOSwift.build/Debug-iphonesimulator/GEOSwift.build/Objects-normal/x86_64/CoreTypes+GEOS.swiftdeps -target x86_64-apple-ios8.0-simulator -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk -I /Users/andrew/Library/Developer/Xcode/DerivedData/GEOSwift-cmzccelinnedlbbaiqoswbevrzry/Build/Products/Debug-iphonesimulator -F /Users/andrew/Library/Developer/Xcode/DerivedData/GEOSwift-cmzccelinnedlbbaiqoswbevrzry/Build/Products/Debug-iphonesimulator -F /Users/andrew/Library/Developer/Xcode/DerivedData/GEOSwift-cmzccelinnedlbbaiqoswbevrzry/Build/Products/Debug-iphonesimulator/geos -enable-testing -g -import-underlying-module -module-cache-path /Users/andrew/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -profile-generate -profile-coverage-mapping -swift-version 5 -enforce-exclusivity=checked -Onone -D DEBUG -serialize-debugging-options -Xcc -working-directory -Xcc /Users/andrew/Developer/GEOSwift -enable-anonymous-context-mangled-names -Xcc -I/Users/andrew/Library/Developer/Xcode/DerivedData/GEOSwift-cmzccelinnedlbbaiqoswbevrzry/Build/Intermediates.noindex/GEOSwift.build/Debug-iphonesimulator/GEOSwift.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/andrew/Library/Developer/Xcode/DerivedData/GEOSwift-cmzccelinnedlbbaiqoswbevrzry/Build/Intermediates.noindex/GEOSwift.build/Debug-iphonesimulator/GEOSwift.build/GEOSwift-generated-files.hmap -Xcc -I/Users/andrew/Library/Developer/Xcode/DerivedData/GEOSwift-cmzccelinnedlbbaiqoswbevrzry/Build/Intermediates.noindex/GEOSwift.build/Debug-iphonesimulator/GEOSwift.build/GEOSwift-own-target-headers.hmap -Xcc -I/Users/andrew/Library/Developer/Xcode/DerivedData/GEOSwift-cmzccelinnedlbbaiqoswbevrzry/Build/Intermediates.noindex/GEOSwift.build/Debug-iphonesimulator/GEOSwift.build/GEOSwift-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/andrew/Library/Developer/Xcode/DerivedData/GEOSwift-cmzccelinnedlbbaiqoswbevrzry/Build/Intermediates.noindex/GEOSwift.build/Debug-iphonesimulator/GEOSwift.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/andrew/Library/Developer/Xcode/DerivedData/GEOSwift-cmzccelinnedlbbaiqoswbevrzry/Build/Intermediates.noindex/GEOSwift.build/Debug-iphonesimulator/GEOSwift.build/GEOSwift-project-headers.hmap -Xcc -I/Users/andrew/Library/Developer/Xcode/DerivedData/GEOSwift-cmzccelinnedlbbaiqoswbevrzry/Build/Products/Debug-iphonesimulator/include -Xcc -I/Users/andrew/Library/Developer/Xcode/DerivedData/GEOSwift-cmzccelinnedlbbaiqoswbevrzry/Build/Products/Debug-iphonesimulator/geos/geos.framework/Headers -Xcc -I/Users/andrew/Library/Developer/Xcode/DerivedData/GEOSwift-cmzccelinnedlbbaiqoswbevrzry/Build/Intermediates.noindex/GEOSwift.build/Debug-iphonesimulator/GEOSwift.build/DerivedSources-normal/x86_64 -Xcc -I/Users/andrew/Library/Developer/Xcode/DerivedData/GEOSwift-cmzccelinnedlbbaiqoswbevrzry/Build/Intermediates.noindex/GEOSwift.build/Debug-iphonesimulator/GEOSwift.build/DerivedSources/x86_64 -Xcc -I/Users/andrew/Library/Developer/Xcode/DerivedData/GEOSwift-cmzccelinnedlbbaiqoswbevrzry/Build/Intermediates.noindex/GEOSwift.build/Debug-iphonesimulator/GEOSwift.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -Xcc -DGEOS_USE_ONLY_R_API -Xcc -ivfsoverlay -Xcc /Users/andrew/Library/Developer/Xcode/DerivedData/GEOSwift-cmzccelinnedlbbaiqoswbevrzry/Build/Intermediates.noindex/GEOSwift.build/Debug-iphonesimulator/GEOSwift.build/unextended-module-overlay.yaml -module-name GEOSwift -o /Users/andrew/Library/Developer/Xcode/DerivedData/GEOSwift-cmzccelinnedlbbaiqoswbevrzry/Build/Intermediates.noindex/GEOSwift.build/Debug-iphonesimulator/GEOSwift.build/Objects-normal/x86_64/CoreTypes+GEOS.o -index-store-path /Users/andrew/Library/Developer/Xcode/DerivedData/GEOSwift-cmzccelinnedlbbaiqoswbevrzry/Index/DataStore -index-system-modules`` ``/Users/andrew/Developer/GEOSwift/GEOSwift/GEOS/CoreTypes+GEOS.swift:102:40: error: failed to produce diagnostic for expression; please file a bug report`` let interiorRingGeometry = GEOSGeometry(parent: geometry, pointer: interiorRingPointer)`` ^

@macdrevx
Copy link
Author

Setting a return type on the block where the error occurred made it go away.

@belkadan
Copy link
Contributor

Thank you for taking the time to file it!

cc @xedin

@macdrevx
Copy link
Author

You're welcome!

@hborla
Copy link
Member

hborla commented Jul 23, 2020

I can't reproduce this in Swift 5.3. The compiler now produces:

error: unable to infer complex closure return type; add explicit type to disambiguate
    let interiorRings = try Array(0..<numInteriorRings).map { (index) in
                                                            ^
                                                                      -> <#Result#> 

with a Fix-It to insert the return type in the closure annotation. Could you please verify using Xcode 12 beta? Thank you!

@macdrevx
Copy link
Author

Verified! Thanks @hborla

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added failed to produce diagnostic Bug → internal error: Failed to produce diagnostic for expression diagnostics QoI Bug: Diagnostics Quality of Implementation labels Dec 22, 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 diagnostics QoI Bug: Diagnostics Quality of Implementation failed to produce diagnostic Bug → internal error: Failed to produce diagnostic for expression type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

4 participants