File tree 5 files changed +22
-2
lines changed
5 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,10 @@ object Settings:
47
47
values(idx) = x
48
48
changed.add(idx)
49
49
this
50
+
51
+ def reinitializedCopy (): SettingsState =
52
+ SettingsState (values.toSeq, changed.toSet)
53
+
50
54
end SettingsState
51
55
52
56
case class ArgsSummary (
Original file line number Diff line number Diff line change @@ -342,10 +342,13 @@ object Inlines:
342
342
if Inlines .isInlineable(codeArg1.symbol) then stripTyped(Inlines .inlineCall(codeArg1))
343
343
else codeArg1
344
344
345
+ // We should not be rewriting tested strings
346
+ val noRewriteSettings = ctx.settings.rewrite.updateIn(ctx.settingsState.reinitializedCopy(), None )
347
+
345
348
ConstFold (underlyingCodeArg).tpe.widenTermRefExpr match {
346
349
case ConstantType (Constant (code : String )) =>
347
350
val source2 = SourceFile .virtual(" tasty-reflect" , code)
348
- inContext(ctx.fresh.setNewTyperState().setTyper(new Typer (ctx.nestingLevel + 1 )).setSource(source2)) {
351
+ inContext(ctx.fresh.setSettings(noRewriteSettings). setNewTyperState().setTyper(new Typer (ctx.nestingLevel + 1 )).setSource(source2)) {
349
352
val tree2 = new Parser (source2).block()
350
353
if ctx.reporter.allErrors.nonEmpty then
351
354
ctx.reporter.allErrors.map((ErrorKind .Parser , _))
Original file line number Diff line number Diff line change @@ -135,3 +135,6 @@ parsercombinators-new-syntax.scala
135
135
hylolib-deferred-given
136
136
hylolib-cb
137
137
hylolib
138
+
139
+ # typecheckErrors method unpickling
140
+ i21415.scala
Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ tuple-zip.scala
27
27
tuples1.scala
28
28
tuples1a.scala
29
29
tuples1b.scala
30
- typeCheckErrors.scala
31
30
typeclass-derivation-doc-example.scala
32
31
typeclass-derivation1.scala
33
32
typeclass-derivation2.scala
@@ -47,3 +46,6 @@ trait-static-forwarder
47
46
i17255
48
47
named-tuples-strawman-2.scala
49
48
49
+ # typecheckErrors method unpickling
50
+ typeCheckErrors.scala
51
+
Original file line number Diff line number Diff line change
1
+ //> using options -rewrite -source:3.4-migration
2
+ import scala .compiletime .testing .typeCheckErrors
3
+
4
+ def foo (arg : Int ): Unit = ???
5
+
6
+ @ main def Test =
7
+ typeCheckErrors(" Seq.empty[Int].foreach(foo.apply _)" )
8
+ typeCheckErrors(" Seq.empty[Int].foreach(foo.apply _)" )
You can’t perform that action at this time.
0 commit comments