From 100ba0eb73d497874afc0e7c3c3a07c2b9405e4e Mon Sep 17 00:00:00 2001 From: Ondrej Lhotak Date: Thu, 31 Mar 2022 11:07:03 +0200 Subject: [PATCH] add instructions for viewing contents of .tasty files to Tasty Overview --- scala3/guides/tasty-overview.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scala3/guides/tasty-overview.md b/scala3/guides/tasty-overview.md index 11d0fa3608..1bf643bebd 100644 --- a/scala3/guides/tasty-overview.md +++ b/scala3/guides/tasty-overview.md @@ -52,6 +52,13 @@ $ scalac | Hello.scala | -> | Hello.tasty | -> | Hello.class | information) ``` +You can view the contents of a _.tasty_ file in a human-readable form by running the compiler on it with the `-print-tasty` flag. +You can also view the contents decompiled in a form similar to Scala source code using the `-decompile` flag. +```bash +$ scalac -print-tasty hello.tasty +$ scalac -decompile hello.tasty +``` + ### The issue with _.class_ files Because of issues such as [type erasure][erasure], _.class_ files are actually an incomplete representation of your code.