mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When an function has an async alternative, that should be preferred when we are completing in an async context. Thus, the sync method should be marked as not recommended if the current context can handle async methods. rdar://88354910
61 lines
2.4 KiB
C++
61 lines
2.4 KiB
C++
//===--- DiagnosticsIDE.def - Diagnostics Text ------------------*- C++ -*-===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2021 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#define DEFINE_DIAGNOSTIC_MACROS
|
|
#include "DefineDiagnosticMacros.h"
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
ERROR(ide_async_in_nonasync_context, none,
|
|
"async %0 used in a context that does not support concurrency",
|
|
(StringRef))
|
|
|
|
// NOTE: This is WARNING because this is emitted for cross actor references with
|
|
// non-'Sendable' types. That is optionally ('-warn-concurrency') warning in
|
|
// Swift 5.5.
|
|
WARNING(ide_cross_actor_reference_swift5, none,
|
|
"actor-isolated %0 should only be referenced from inside the actor",
|
|
(StringRef))
|
|
|
|
WARNING(ide_has_async_alternative, none,
|
|
"%0 has an async alternative that should be preferred in an async "
|
|
"context", (StringRef))
|
|
|
|
WARNING(ide_redundant_import, none,
|
|
"module %0 is already imported", (StringRef))
|
|
|
|
// FIXME: Inform which other 'import' this module came from.
|
|
NOTE(ide_redundant_import_indirect, none,
|
|
"module %0 is already imported via another module import", (StringRef))
|
|
|
|
WARNING(ide_availability_softdeprecated, Deprecation,
|
|
"%select{getter for |setter for |}0%1 will be deprecated"
|
|
" in %select{a future version|%select{a future version of %3|%3 %5}4}2"
|
|
"%select{|: %6}6",
|
|
(unsigned, DeclName, bool, StringRef, bool, llvm::VersionTuple,
|
|
StringRef))
|
|
|
|
WARNING(ide_availability_softdeprecated_rename, Deprecation,
|
|
"%select{getter for |setter for |}0%1 will be deprecated"
|
|
" in %select{a future version|%select{a future version of %3|%3 %5}4}2"
|
|
": renamed to '%6'",
|
|
(unsigned, DeclName, bool, StringRef, bool, llvm::VersionTuple, StringRef))
|
|
|
|
WARNING(ide_recursive_accessor_reference,none,
|
|
"attempting to %select{access|modify}1 %0 within its own "
|
|
"%select{getter|setter}1", (StringRef, bool))
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#define UNDEFINE_DIAGNOSTIC_MACROS
|
|
#include "DefineDiagnosticMacros.h"
|