File tree 3 files changed +25
-1
lines changed
compiler/test/dotty/tools/dotc
3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -195,7 +195,8 @@ class CompilationTests extends ParallelTesting {
195
195
implicit val testGroup : TestGroup = TestGroup (" runAll" )
196
196
compileFilesInDir(" ../tests/run" , defaultOptions) +
197
197
compileFilesInDir(" ../tests/run-no-optimise" , defaultOptions) +
198
- compileFile(" ../tests/run-special/quote-run.scala" , defaultRunWithCompilerOptions)
198
+ compileFile(" ../tests/run-special/quote-run.scala" , defaultRunWithCompilerOptions) +
199
+ compileFile(" ../tests/run-special/quote-run-2.scala" , defaultRunWithCompilerOptions)
199
200
}.checkRuns()
200
201
201
202
// Generic java signatures tests ---------------------------------------------
Original file line number Diff line number Diff line change
1
+ 1.0
2
+ 5.0
Original file line number Diff line number Diff line change
1
+
2
+ import dotty .tools .dotc .quoted .Runners ._
3
+
4
+ import scala .quoted ._
5
+
6
+ object Test {
7
+ def main (args : Array [String ]): Unit = {
8
+ def powerCode (n : Int , x : Expr [Double ]): Expr [Double ] =
9
+ if (n == 0 ) '(1.0)
10
+ else if (n == 1 ) x
11
+ else if (n % 2 == 0 ) ' { { val y = ~ x * ~ x; ~ powerCode(n / 2 , '(y)) } }
12
+ else ' { ~ x * ~ powerCode(n - 1 , x) }
13
+
14
+ println(powerCode(0 , '(5)).show)
15
+ println(powerCode(1 , '(5)).show)
16
+ // FIXME
17
+ // println(powerCode(2, '(5)).show)
18
+ // println(powerCode(3, '(5)).show)
19
+
20
+ }
21
+ }
You can’t perform that action at this time.
0 commit comments