From 170877ab681425c5c560621ff7106a6d0200748c Mon Sep 17 00:00:00 2001 From: Maximilien Tirard Date: Thu, 9 Jun 2022 00:19:02 +0100 Subject: [PATCH 1/2] Fixed error in detailed inlining steps --- _overviews/scala3-macros/tutorial/inline.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_overviews/scala3-macros/tutorial/inline.md b/_overviews/scala3-macros/tutorial/inline.md index e27d610b18..c900e30401 100644 --- a/_overviews/scala3-macros/tutorial/inline.md +++ b/_overviews/scala3-macros/tutorial/inline.md @@ -276,8 +276,8 @@ val x = 2 val x2 = x * x x2 * { if (0 == 0) 1.0 - else if (0 % 2 == 1) x * power(x, 0 - 1) // dead branch - else power(x * x, 0 / 2) // dead branch + else if (0 % 2 == 1) x * power(x2, 0 - 1) // dead branch + else power(x2 * x2, 0 / 2) // dead branch } // partially evaluated to val x = 2 From 56d3742b8e9433ae314ec07c8864348a703c6256 Mon Sep 17 00:00:00 2001 From: Julien Richard-Foy Date: Thu, 9 Jun 2022 09:06:28 +0200 Subject: [PATCH 2/2] Update _overviews/scala3-macros/tutorial/inline.md --- _overviews/scala3-macros/tutorial/inline.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_overviews/scala3-macros/tutorial/inline.md b/_overviews/scala3-macros/tutorial/inline.md index c900e30401..79ce94e4ba 100644 --- a/_overviews/scala3-macros/tutorial/inline.md +++ b/_overviews/scala3-macros/tutorial/inline.md @@ -276,7 +276,7 @@ val x = 2 val x2 = x * x x2 * { if (0 == 0) 1.0 - else if (0 % 2 == 1) x * power(x2, 0 - 1) // dead branch + else if (0 % 2 == 1) x2 * power(x2, 0 - 1) // dead branch else power(x2 * x2, 0 / 2) // dead branch } // partially evaluated to