Skip to content

Commit ed61847

Browse files
committed
Fix #3515: Do not save tasty in .class with -YemitTasty
Only emit .tasty file
1 parent cc43c34 commit ed61847

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/backend/jvm/GenBCode.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,16 +223,16 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
223223

224224
if (claszSymbol.isClass) // @DarkDimius is this test needed here?
225225
for (binary <- ctx.compilationUnit.pickled.get(claszSymbol.asClass)) {
226-
val dataAttr = new CustomAttr(nme.TASTYATTR.mangledString, binary)
227226
val store = if (mirrorC ne null) mirrorC else plainC
228-
store.visitAttribute(dataAttr)
229227
if (ctx.settings.emitTasty.value) {
230228
val outTastyFile = getFileForClassfile(outF, store.name, ".tasty")
231229
val outstream = new DataOutputStream(outTastyFile.bufferedOutput)
232230

233231
try outstream.write(binary)
234232
finally outstream.close()
235233
} else {
234+
val dataAttr = new CustomAttr(nme.TASTYATTR.mangledString, binary)
235+
store.visitAttribute(dataAttr)
236236
// Create an empty file to signal that a tasty section exist in the corresponding .class
237237
// This is much cheaper and simpler to check than doing classfile parsing
238238
getFileForClassfile(outF, store.name, ".hasTasty")

0 commit comments

Comments
 (0)