gpt4 book ai didi

ios - 反序列化 SIL 全局 "UIEdgeInsetsZero"时遇到 fatal error

转载 作者:技术小花猫 更新时间:2023-10-29 10:40:49 26 4
gpt4 key购买 nike

使用 Swift 4.2 和 Xcode 10 beta,如果我写:

import UIKit
let foo: UIEdgeInsets = .zero

然后我在编译时遇到一个 fatal error :

*** DESERIALIZATION FAILURE (please include this section in any bug report) ***
result is ambiguous
0 swift 0x000000010784fc5a PrintStackTraceSignalHandler(void*) + 42
1 swift 0x000000010784f066 SignalHandler(int) + 966
2 libsystem_platform.dylib 0x00007fff62a5ef5a _sigtramp + 26
3 libsystem_platform.dylib 0x0000000000000010 _sigtramp + 2639925456
4 libsystem_c.dylib 0x00007fff627fc1ae abort + 127
5 swift 0x0000000104cf599b swift::ModuleFile::fatal(llvm::Error) + 1915
6 swift 0x0000000104d2d4d2 swift::SILDeserializer::readGlobalVar(llvm::StringRef) + 1890
7 swift 0x0000000104dd7f9a swift::SerializedSILLoader::getAllForModule(swift::Identifier, swift::FileUnit*) + 234
8 swift 0x0000000103b2adbe performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 34750
9 swift 0x0000000103b1f10f swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7839
10 swift 0x0000000103ac8c48 main + 13144
11 libdyld.dylib 0x00007fff62750015 start + 1
12 libdyld.dylib 0x0000000000000041 start + 2643132461
Stack dump:
0. Program arguments: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -merge-modules -emit-module /Users/coeur/Library/Developer/Xcode/DerivedData/Edgy-gbvthkytwkmyekdynhvvbtmysdbk/Build/Intermediates.noindex/Edgy.build/Debug-iphonesimulator/Edgy.build/Objects-normal/x86_64/ViewController~partial.swiftmodule /Users/coeur/Library/Developer/Xcode/DerivedData/Edgy-gbvthkytwkmyekdynhvvbtmysdbk/Build/Intermediates.noindex/Edgy.build/Debug-iphonesimulator/Edgy.build/Objects-normal/x86_64/AppDelegate~partial.swiftmodule /Users/coeur/Library/Developer/Xcode/DerivedData/Edgy-gbvthkytwkmyekdynhvvbtmysdbk/Build/Intermediates.noindex/Edgy.build/Debug-iphonesimulator/Edgy.build/Objects-normal/x86_64/Edgy~partial.swiftmodule -parse-as-library -sil-merge-partial-modules -disable-diagnostic-passes -disable-sil-perf-optzns -target x86_64-apple-ios12.0-simulator -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk -I /Users/coeur/Library/Developer/Xcode/DerivedData/Edgy-gbvthkytwkmyekdynhvvbtmysdbk/Build/Products/Debug-iphonesimulator -F /Users/coeur/Library/Developer/Xcode/DerivedData/Edgy-gbvthkytwkmyekdynhvvbtmysdbk/Build/Products/Debug-iphonesimulator -enable-testing -g -module-cache-path /Users/coeur/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 4.2 -enforce-exclusivity=checked -Onone -D DEBUG -serialize-debugging-options -Xcc -working-directory -Xcc /Users/coeur/Development/Edgy -Xcc -I/Users/coeur/Library/Developer/Xcode/DerivedData/Edgy-gbvthkytwkmyekdynhvvbtmysdbk/Build/Intermediates.noindex/Edgy.build/Debug-iphonesimulator/Edgy.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/coeur/Library/Developer/Xcode/DerivedData/Edgy-gbvthkytwkmyekdynhvvbtmysdbk/Build/Intermediates.noindex/Edgy.build/Debug-iphonesimulator/Edgy.build/Edgy-generated-files.hmap -Xcc -I/Users/coeur/Library/Developer/Xcode/DerivedData/Edgy-gbvthkytwkmyekdynhvvbtmysdbk/Build/Intermediates.noindex/Edgy.build/Debug-iphonesimulator/Edgy.build/Edgy-own-target-headers.hmap -Xcc -I/Users/coeur/Library/Developer/Xcode/DerivedData/Edgy-gbvthkytwkmyekdynhvvbtmysdbk/Build/Intermediates.noindex/Edgy.build/Debug-iphonesimulator/Edgy.build/Edgy-all-target-headers.hmap -Xcc -iquote -Xcc /Users/coeur/Library/Developer/Xcode/DerivedData/Edgy-gbvthkytwkmyekdynhvvbtmysdbk/Build/Intermediates.noindex/Edgy.build/Debug-iphonesimulator/Edgy.build/Edgy-project-headers.hmap -Xcc -I/Users/coeur/Library/Developer/Xcode/DerivedData/Edgy-gbvthkytwkmyekdynhvvbtmysdbk/Build/Products/Debug-iphonesimulator/include -Xcc -I/Users/coeur/Library/Developer/Xcode/DerivedData/Edgy-gbvthkytwkmyekdynhvvbtmysdbk/Build/Intermediates.noindex/Edgy.build/Debug-iphonesimulator/Edgy.build/DerivedSources/x86_64 -Xcc -I/Users/coeur/Library/Developer/Xcode/DerivedData/Edgy-gbvthkytwkmyekdynhvvbtmysdbk/Build/Intermediates.noindex/Edgy.build/Debug-iphonesimulator/Edgy.build/DerivedSources -Xcc -DDEBUG=1 -emit-module-doc-path /Users/coeur/Library/Developer/Xcode/DerivedData/Edgy-gbvthkytwkmyekdynhvvbtmysdbk/Build/Intermediates.noindex/Edgy.build/Debug-iphonesimulator/Edgy.build/Objects-normal/x86_64/Edgy.swiftdoc -emit-objc-header-path /Users/coeur/Library/Developer/Xcode/DerivedData/Edgy-gbvthkytwkmyekdynhvvbtmysdbk/Build/Intermediates.noindex/Edgy.build/Debug-iphonesimulator/Edgy.build/Objects-normal/x86_64/Edgy-Swift.h -module-name Edgy -o /Users/coeur/Library/Developer/Xcode/DerivedData/Edgy-gbvthkytwkmyekdynhvvbtmysdbk/Build/Intermediates.noindex/Edgy.build/Debug-iphonesimulator/Edgy.build/Objects-normal/x86_64/Edgy.swiftmodule
1. While deserializing SIL global "UIEdgeInsetsZero"
error: Abort trap: 6

最佳答案

这是我为 Xcode 10 betaXcode 10 beta 2 找到的解决方法。在你更新 Xcode 之前,只是暂时将它包含在你的项目中的某个地方:

#if swift(>=4.2)
import UIKit.UIGeometry
extension UIEdgeInsets {
public static let zero = UIEdgeInsets()
}
#endif

问题已在 Xcode 10 beta 3 中解决和更新。

(由于这个拉取请求,解决方案发生了:https://github.com/apple/swift/pull/17122)

关于ios - 反序列化 SIL 全局 "UIEdgeInsetsZero"时遇到 fatal error ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50704200/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com