Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions SwiftCompilerSources/Sources/AST/Type.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ extension TypeProperties {
public var isExistentialMetatype: Bool { rawType.bridged.isExistentialMetatypeType() }
public var isDynamicSelf: Bool { rawType.bridged.isDynamicSelf()}
public var isBox: Bool { rawType.bridged.isBox() }
public var isPack: Bool { rawType.bridged.isPack() }
public var isSILPack: Bool { rawType.bridged.isSILPack() }

public var canBeClass: Type.TraitResult { rawType.bridged.canBeClass().result }

Expand Down Expand Up @@ -263,6 +265,14 @@ extension TypeProperties {
public func checkConformance(to protocol: ProtocolDecl) -> Conformance {
return Conformance(bridged: rawType.bridged.checkConformance(`protocol`.bridged))
}

public var containsSILPackExpansionType: Bool {
return rawType.bridged.containsSILPackExpansionType()
}

public var isSILPackElementAddress: Bool {
return rawType.bridged.isSILPackElementAddress()
}
}

public struct TypeArray : RandomAccessCollection, CustomReflectable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ swift_compiler_sources(Optimizer
StripObjectHeaders.swift
TempLValueElimination.swift
TempRValueElimination.swift
PackSpecialization.swift
)
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ private func specializeClosure(specializedName: String,
newParams.append(contentsOf: nonConstantArguments.map { partialApply.parameter(for: $0)! })

let isGeneric = newParams.contains { $0.type.hasTypeParameter } ||
callee.convention.results.contains { $0.type.hasTypeParameter() } ||
callee.convention.errorResult?.type.hasTypeParameter() ?? false
callee.convention.results.contains { $0.type.hasTypeParameter } ||
callee.convention.errorResult?.type.hasTypeParameter ?? false

let specializedClosure = context.createSpecializedFunctionDeclaration(from: callee,
withName: specializedName,
Expand Down
Loading