From 169d021f8f0281b3fe1a36d252b2230ad88ac391 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Mon, 8 Jun 2020 14:17:19 +0200 Subject: [PATCH] Fix #8839: Only warn if TASTy is not in sync with classfile If they are not in sync, we warn and suggest to clean. We assume that the TASTy is up to date (arbitrary choise) and load it regardless. This way we are resiliant to the failiure if the loaded class API did not change or did not have an impact on the code we are compiling. --- .../src/dotty/tools/dotc/core/classfile/ClassfileParser.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala index 6e55be500bf2..0ecca2cb9470 100644 --- a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala +++ b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala @@ -825,7 +825,7 @@ class ClassfileParser( val expectedUUID = new UUID(reader.readUncompressedLong(), reader.readUncompressedLong()) val tastyUUID = new TastyHeaderUnpickler(tastyBytes).readHeader() if (expectedUUID != tastyUUID) - ctx.error(s"Tasty UUID ($tastyUUID) file did not correspond the tasty UUID ($expectedUUID) declared in the classfile $classfile.") + ctx.warning(s"$classfile is out of sync with its TASTy file. Loaded TASTy file. Try cleaning the project to fix this issue", NoSourcePosition) return unpickleTASTY(tastyBytes) } }