Skip to content

Commit 285cd40

Browse files
authored
Fix inductive-implicits benchmark (#22007)
The `inductive-implicits` benchmark fails on the benchmarks machine since April 2024: <img width="1261" alt="image" src="https://github.com/user-attachments/assets/2b53a1e8-5a5d-4c76-a795-b4733d975f5b"> This _should_ have been caught by the tests at: https://github.com/scala/scala3/blob/912b6f278b0fe5e7a25160612922cadf184acdbb/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala#L30 When I run `scala3-bootstrapped / testOnly dotty.tools.dotc.BootstrappedOnlyCompilationTests -- *posMacros` locally, the tests are indeed failing and the following error is printed: ```scala 64 | val sel = Selector[L, Boolean] | ^ |No given instance of type shapeless.Selector[Test.L, Boolean] was found for parameter selector of method apply in object Selector. |I found: | | shapeless.Selector.inTail[Int, | Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: | Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int | :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: | Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int | :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: | Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: ...Int :: ... :: ... :: ..., | Boolean]( | shapeless.Selector.inTail[Int, | Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int | :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: | Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: | Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: | Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: | Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: ...Int :: ... :: ... :: ..., | Boolean]( | shapeless.Selector.inTail[Int, | Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: | Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: | Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: | Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: | Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: | Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: ...Int :: ... :: ... :: ..., | Boolean]( ... | ) | ) | ) | ) | ) | |But method inTail in object Selector does not match type shapeless.Selector[ | Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: | Boolean :: shapeless.HNil, |Boolean]. | |Note: method inTail in object Selector was not considered because it was not imported with `import given`. ``` It is not clear to me why the test does not fail on the CI. I checked that `dotty.tools.dotc.BootstrappedOnlyCompilationTests.posMacros` indeed runs there, and I confirm it is the case. Anyway, the fix is simple, we just need to import the implicits explicitly. This PR additionally removes the duplicate `tests/pos-deep-subtype/inductive-implicits-bench.scala`.
2 parents f8159a3 + d3b9d76 commit 285cd40

File tree

2 files changed

+38
-165
lines changed

2 files changed

+38
-165
lines changed

tests/bench/inductive-implicits.scala

+38-38
Original file line numberDiff line numberDiff line change
@@ -174,49 +174,49 @@ object Test extends App {
174174
Int ::
175175
Int ::
176176
//
177-
Int ::
178-
Int ::
179-
Int ::
180-
Int ::
181-
Int ::
182-
Int ::
183-
Int ::
184-
Int ::
185-
Int ::
186-
Int ::
187-
//
188-
Int ::
189-
Int ::
190-
Int ::
191-
Int ::
192-
Int ::
193-
Int ::
194-
Int ::
195-
Int ::
196-
Int ::
197-
Int ::
198-
//
199-
Int ::
200-
Int ::
201-
Int ::
202-
Int ::
203-
Int ::
204-
Int ::
205-
Int ::
206-
Int ::
207-
Int ::
208-
Int ::
209-
//
210-
Int ::
211-
Int ::
212-
Int ::
213-
Int ::
214-
Int ::
215177
// Int ::
216178
// Int ::
217179
// Int ::
218180
// Int ::
219181
// Int ::
182+
// Int ::
183+
// Int ::
184+
// Int ::
185+
// Int ::
186+
// Int ::
187+
// //
188+
// Int ::
189+
// Int ::
190+
// Int ::
191+
// Int ::
192+
// Int ::
193+
// Int ::
194+
// Int ::
195+
// Int ::
196+
// Int ::
197+
// Int ::
198+
// //
199+
// Int ::
200+
// Int ::
201+
// Int ::
202+
// Int ::
203+
// Int ::
204+
// Int ::
205+
// Int ::
206+
// Int ::
207+
// Int ::
208+
// Int ::
209+
// //
210+
// Int ::
211+
// Int ::
212+
// Int ::
213+
// Int ::
214+
// Int ::
215+
// Int ::
216+
// Int ::
217+
// Int ::
218+
// Int ::
219+
// Int ::
220220
// //
221221
// Int ::
222222
// Int ::

tests/pos-deep-subtype/inductive-implicits-bench.scala

-127
This file was deleted.

0 commit comments

Comments
 (0)