Open SharonXSharon opened 12 months ago
@gottesmm @eeckstein Hey Erik and Michael, wondering if you have any pointer/suggestion on how to fix this issue?
Thanks, Manman
@manman-ren thanks for the ping. I'll check who can take care of this
Corresponding radar: rdar://115355709
Using the Xcode 15.0 RC (15A240d), I have been able to avoid the crash by commenting the @_alwaysEmitIntoClient
annotation of DynamicIslandExpandedContentBuilder.buildPartialBlock<C0, C1>(accumulated: WidgetKit.DynamicIslandExpandedContent<C0>, next: WidgetKit.DynamicIslandExpandedRegion<C1>) -> WidgetKit.DynamicIslandExpandedContent<some SwiftUI.View> where C0 : SwiftUI.View, C1 : SwiftUI.View
A minimal repro seems to be the using the following .swiftinterface
file:
// swift-interface-format-version: 1.0
// swift-compiler-version: Apple Swift version 5.9 (swiftlang-5.9.0.123.204 clang-1500.0.37.1)
// swift-module-flags: -target arm64-apple-ios17.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -library-level api -module-name WidgetKit
// swift-module-flags-ignorable: -enable-experimental-feature FreestandingMacros -enable-bare-slash-regex -user-module-version 401.1.107
import SwiftUI
@available(iOS 16.1, *)
@available(macOS, unavailable)
@available(tvOS, unavailable)
@available(watchOS, unavailable)
public struct DynamicIslandExpandedContent<Content> where Content : SwiftUI.View {
@usableFromInline
internal var content: Content
@usableFromInline
internal init(@SwiftUI.ViewBuilder content: () -> Content)
}
@available(iOS 16.1, *)
@available(macOS, unavailable)
@available(tvOS, unavailable)
@available(watchOS, unavailable)
@_functionBuilder public struct DynamicIslandExpandedContentBuilder {
@_alwaysEmitIntoClient public static func buildPartialBlock<C>(first: WidgetKit.DynamicIslandExpandedRegion<C>) -> WidgetKit.DynamicIslandExpandedContent<some SwiftUI.View> where C : SwiftUI.View {
DynamicIslandExpandedContent {
first._viewRepresentation
}
}
// REMOVE @_alwaysEmitIntoClient HERE
@_alwaysEmitIntoClient public static func buildPartialBlock<C0, C1>(accumulated: WidgetKit.DynamicIslandExpandedContent<C0>, next: WidgetKit.DynamicIslandExpandedRegion<C1>) -> WidgetKit.DynamicIslandExpandedContent<some SwiftUI.View> where C0 : SwiftUI.View, C1 : SwiftUI.View {
DynamicIslandExpandedContent {
accumulated.content
next._viewRepresentation
}
}
}
@available(iOS 16.1, *)
@available(macOS, unavailable)
@available(tvOS, unavailable)
@available(watchOS, unavailable)
public struct DynamicIslandExpandedRegion<Content> where Content : SwiftUI.View {
@SwiftUI.ViewBuilder content: () -> Content)
public var _viewRepresentation: some SwiftUI.View {
get
}
}
I was able to get the results described in issue with the swift.org
toolchain downloaded from https://download.swift.org/swift-5.9-branch/xcode/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-09-05-a/swift-5.9-DEVELOPMENT-SNAPSHOT-2023-09-05-a-osx.pkg
Description
The
swiftc
throws an assertion failure(ty->isLegalSILType() && "constructing SILType with type that should have been " "eliminated by SIL lowering"), function SILType, file SILType.h, line 114
, when building theWidgetKit.swiftmodule
from theWidgetKit.swiftmodule/arm64-apple-ios.swiftinterface
.Full trace of the assertion:
Steps to reproduce
swiftc
(5.9) with asserts enabled. I pulled the open-source swift 5.9 branch https://github.com/apple/swift/tree/release/5.9 and built the toolchain following https://github.com/apple/swift/blob/release/5.9/docs/HowToGuides/GettingStarted.mdExpected behavior
Compilation finishes successfully without assertion failure.
Environment
Swift version 5.9-dev (LLVM 8e2daa73d613753, Swift a1292875235823f) Target: arm64-apple-macosx13.0
Xcode 15 Beta 7 (15A5229h)
.