From 07de94237cd0a2e07ea2bcbe8f6c4dcb31ce78cf Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 27 Jul 2023 13:29:21 +0200 Subject: [PATCH] Nim: Simplify error message creation for missing compilers NimToolChains are the only ones with Constants::C_NIMLANGUAGE_ID, no need to double-check with dynamic cast. Change-Id: I1542128903261f8cfd2e20533b0589f9ceb7bc50 Reviewed-by: Jarek Kobus --- src/plugins/nim/project/nimproject.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/nim/project/nimproject.cpp b/src/plugins/nim/project/nimproject.cpp index 4a2bc060260..0e3240600f9 100644 --- a/src/plugins/nim/project/nimproject.cpp +++ b/src/plugins/nim/project/nimproject.cpp @@ -6,13 +6,13 @@ #include "../nimconstants.h" #include "../nimtr.h" #include "nimbuildsystem.h" -#include "nimtoolchain.h" #include #include #include #include +#include using namespace ProjectExplorer; using namespace Utils; @@ -52,7 +52,7 @@ NimProject::NimProject(const FilePath &filePath) : Project(Constants::C_NIM_MIME Tasks NimProject::projectIssues(const Kit *k) const { Tasks result = Project::projectIssues(k); - auto tc = dynamic_cast(ToolChainKitAspect::toolChain(k, Constants::C_NIMLANGUAGE_ID)); + auto tc = ToolChainKitAspect::toolChain(k, Constants::C_NIMLANGUAGE_ID); if (!tc) { result.append(createProjectTask(Task::TaskType::Error, Tr::tr("No Nim compiler set."))); return result;