Skip to content

Commit 12be72d

Browse files
Fix i7407 test error message
FTTB it is a cyclic error. It requests the user to fully specify the type of the method. Once they do so, an intended "implicit not found" message appears. Displaying the correct message directly requires adding `Macro` flag to `FromStartFlags`, which is not correct. Until we find a workaround, this solution is a reasonable trade-off because it offers an unambiguous action (to fully specify the type of the method) for the user to take to see the correct error message. The reason the cyclic error appears in first place is as follows. Given `inline def g = qc`, we typecheck `qc`. However, `qc` requires an implicit QuoteContext which can only be synthetically generated for the bodies of macros. Hence we need to see if `g` is a macro, and to do so, we need to complete it. To complete it, we need to typecheck its body, which yields the cyclic error.
1 parent 498e11d commit 12be72d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/neg/i7407.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
def qc(given ctx: scala.quoted.QuoteContext) = println(ctx)
2-
inline def g = qc // error: no implicit argument
2+
inline def g = qc // error: cyclic reference

0 commit comments

Comments
 (0)