From 8d8df3357d31a2f9083373741f063b4aac9160d8 Mon Sep 17 00:00:00 2001 From: Gleb Koval Date: Thu, 13 Mar 2025 18:39:11 +0000 Subject: [PATCH] refactor: use getCanonicalPath instead of toRealPath --- src/main/wacc/Main.scala | 2 +- src/main/wacc/frontend/Error.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/wacc/Main.scala b/src/main/wacc/Main.scala index 48166c3..3fef6dc 100644 --- a/src/main/wacc/Main.scala +++ b/src/main/wacc/Main.scala @@ -118,7 +118,7 @@ def compile( _ <- logAction(s"Compilation failed for $filePath\nExit code: $code") _ <- IO.blocking( // Explicit println since we want this to always show without logger thread info e.t.c. - println(s"Compilation failed for ${file.toPath.toRealPath()}:\n$errorMsg") + println(s"Compilation failed for ${file.getCanonicalPath}:\n$errorMsg") ) } yield code diff --git a/src/main/wacc/frontend/Error.scala b/src/main/wacc/frontend/Error.scala index ed113ae..7c2ab7e 100644 --- a/src/main/wacc/frontend/Error.scala +++ b/src/main/wacc/frontend/Error.scala @@ -45,7 +45,7 @@ def formatError(error: Error)(using errorContent: String): String = { * File of the error */ def formatFile(file: File): Unit = { - sb.append(s"File: ${file.toPath.toRealPath()}\n") + sb.append(s"File: ${file.getCanonicalPath}\n") } /** Function to format the position of an error