From bde19ecfc61bc278101af3b3bbfc2bad032d6fc5 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Wed, 6 Jun 2018 15:54:16 +0200 Subject: [PATCH] Fix -Ythrough-tasty - dotty.tools.io.Path#extension always return something lowercase for some reason, so comparing against "hasTasty" always returned false - .tasty files were not supported --- compiler/src/dotty/tools/dotc/fromtasty/Debug.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/fromtasty/Debug.scala b/compiler/src/dotty/tools/dotc/fromtasty/Debug.scala index f44ad7d63714..c249f00a2368 100644 --- a/compiler/src/dotty/tools/dotc/fromtasty/Debug.scala +++ b/compiler/src/dotty/tools/dotc/fromtasty/Debug.scala @@ -35,11 +35,11 @@ object Debug { val fromTastyOut = Files.createDirectory(tmpOut.resolve("from-tasty")) - val ext = "hasTasty" - val classes = Directory(fromSourcesOut).walk.filter(x => x.isFile && x.extension == ext).map { x => + val extensions = List("tasty", "hasTasty").map(_.toLowerCase) + val classes = Directory(fromSourcesOut).walk.filter(x => x.isFile && extensions.exists(_ == x.extension.toLowerCase)).map { x => val source = x.toString // transform foo/bar/Baz.hasTasty into foo.bar.Baz - source.substring(fromSourcesOut.toString.length + 1, source.length - ext.length - 1).replace('/', '.') + source.substring(fromSourcesOut.toString.length + 1, source.length - x.extension.length - 1).replace('/', '.') }.toList val fromTastyArgs = {