Skip to content

FlexibleTypes are not handled in Quotes  #20287

Closed
@WojciechMazur

Description

@WojciechMazur

Issue found in OpenCB for scalacenter/tasty-mima - build logs

Compiler version

3.5.0-RC1-bin-20240417-b93c337-NIGHTLY

Minimized code

Not minimized yet

Output

Error:  -- Error: /build/repo/tasty-mima/src/test/scala/tastymima/intf/ProblemSuite.scala:41:18 
Error:  41 |      assert(clue(TestProblem(kind, "<path-string>").getFilterIncantation()) == clue(expected))
Error:     |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error:     |Exception occurred while executing macro expansion.
Error:     |scala.MatchError: FlexibleType(OrType(TypeRef(ThisType(TypeRef(NoPrefix,module class lang)),class String),TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Null)),TypeRef(ThisType(TypeRef(NoPrefix,module class lang)),class String)) (of class dotty.tools.dotc.core.Types$FlexibleType)
Error:     |	at scala.quoted.runtime.impl.printers.Extractors$ExtractorsPrinter.visitType(Extractors.scala:241)
Error:     |	at scala.quoted.runtime.impl.printers.Extractors$.showType(Extractors.scala:12)
Error:     |	at scala.quoted.runtime.impl.QuotesImpl$$anon$19.show(QuotesImpl.scala:3219)
Error:     |	at scala.quoted.runtime.impl.QuotesImpl$$anon$19.show(QuotesImpl.scala:3218)
Error:     |	at scala.quoted.runtime.impl.QuotesImpl$reflect$TypeReprMethods$.show(QuotesImpl.scala:1804)
Error:     |	at scala.quoted.runtime.impl.QuotesImpl$reflect$TypeReprMethods$.show(QuotesImpl.scala:1804)
Error:     |	at scala.quoted.runtime.impl.printers.SourceCode$SourceCodePrinter.printType(SourceCode.scala:1251)
Error:     |	at scala.quoted.runtime.impl.printers.SourceCode$SourceCodePrinter.printTypeAndAnnots$1(SourceCode.scala:1020)
Error:     |	at scala.quoted.runtime.impl.printers.SourceCode$SourceCodePrinter.printTypeTree(SourceCode.scala:1022)
Error:     |	at scala.quoted.runtime.impl.printers.SourceCode$SourceCodePrinter.printTree(SourceCode.scala:527)
Error:     |	at scala.quoted.runtime.impl.printers.SourceCode$.showTree(SourceCode.scala:10)
Error:     |	at scala.quoted.runtime.impl.QuotesImpl$$anon$13.show(QuotesImpl.scala:3195)
Error:     |	at scala.quoted.runtime.impl.QuotesImpl$$anon$13.show(QuotesImpl.scala:3194)
Error:     |	at scala.quoted.runtime.impl.QuotesImpl$reflect$TreeMethods$.show(QuotesImpl.scala:108)
Error:     |	at scala.quoted.runtime.impl.QuotesImpl$reflect$TreeMethods$.show(QuotesImpl.scala:108)
Error:     |	at munit.internal.MacroCompat$.clueImpl(MacroCompat.scala:31)
Error:     |
Error:     |----------------------------------------------------------------------------
Error:     |Inline stack trace
Error:     |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Error:     |This location contains code that was inlined from MacroCompat.scala:24
Error:      ----------------------------------------------------------------------------```

Expectation

Audit and fix the corner cases where FlexibleType might lead to MatchError

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions