//===--- 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",
      (DeclName))

// 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",
        (DeclName))

WARNING(ide_redundant_import, none,
        "module %0 is already imported", (DeclName))

// FIXME: Inform which other 'import' this module came from.
NOTE(ide_redundant_import_indirect, none,
     "module %0 is already imported via another module import", (DeclName))

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))

//===----------------------------------------------------------------------===//

#define UNDEFINE_DIAGNOSTIC_MACROS
#include "DefineDiagnosticMacros.h"
