Skip to content

Gardening: Fix more warnings #80448

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

Merged
merged 4 commits into from
Apr 2, 2025
Merged
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
2 changes: 1 addition & 1 deletion lib/AST/ASTPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4521,7 +4521,7 @@ void PrintAST::visitSubscriptDecl(SubscriptDecl *decl) {
Printer.callPrintStructurePre(PrintStructureKind::FunctionReturnType);

if (!Options.SuppressSendingArgsAndResults) {
if (auto typeRepr = decl->getElementTypeRepr()) {
if (decl->getElementTypeRepr()) {
if (isa<SendingTypeRepr>(decl->getResultTypeRepr()))
Printer << "sending ";
}
Expand Down
2 changes: 1 addition & 1 deletion lib/AST/ProtocolConformanceRef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ ProtocolConformanceRef::subst(Type origType, InFlightSubstitution &IFS) const {

// If the type is an opaque archetype, the conformance will remain abstract,
// unless we're specifically substituting opaque types.
if (auto origArchetype = origType->getAs<OpaqueTypeArchetypeType>()) {
if (origType->getAs<OpaqueTypeArchetypeType>()) {
if (!IFS.shouldSubstituteOpaqueArchetypes()) {
return forAbstract(origType.subst(IFS), proto);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ extension DistributedResolvableMacro {
if var variable = requirement.decl.as(VariableDeclSyntax.self) {
variable.modifiers = variable.modifiers.filter { !$0.isAccessControl }
access.reversed().forEach { modifier in
variable.modifiers = variable.modifiers.prepending(modifier)
variable.modifiers = [modifier] + variable.modifiers
}

var accessorStubs: [String] = []
Expand All @@ -106,7 +106,7 @@ extension DistributedResolvableMacro {
} else if var fun = requirement.decl.as(FunctionDeclSyntax.self) {
fun.modifiers = fun.modifiers.filter { !$0.isAccessControl }
access.reversed().forEach { modifier in
fun.modifiers = fun.modifiers.prepending(modifier)
fun.modifiers = [modifier] + fun.modifiers
}

// normal function stub
Expand Down
4 changes: 2 additions & 2 deletions lib/Macros/Sources/SwiftMacros/SwiftifyImportMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -677,14 +677,14 @@ struct CountedOrSizedReturnPointerThunkBuilder: PointerBoundsThunkBuilder {
if unsafe _resultValue == nil {
return nil
} else {
return unsafe \(raw: try cast)(\(raw: startLabel): _resultValue!, count: Int(\(countExpr)))
return unsafe \(raw: cast)(\(raw: startLabel): _resultValue!, count: Int(\(countExpr)))
}
}()
"""
}
return
"""
unsafe \(raw: try cast)(\(raw: startLabel): \(call), count: Int(\(countExpr)))
unsafe \(raw: cast)(\(raw: startLabel): \(call), count: Int(\(countExpr)))
"""
}
}
Expand Down
1 change: 1 addition & 0 deletions lib/SIL/IR/SILConstants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ void SymbolicValue::print(llvm::raw_ostream &os, unsigned indent) const {
SmallVector<char, 0> stringFloatRepr;
getFloatValue().toString(stringFloatRepr);
os << "float: " << stringFloatRepr << "\n";
return;
}
case RK_String:
os << "string: \"" << getStringValue() << "\"\n";
Expand Down