Uploaded image for project: 'Scala Programming Language'
  1. Scala Programming Language
  2. SI-10081

StackOverflowError in typer with AnnotatedType

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Scala 2.12.0
    • Fix Version/s: Backlog
    • Component/s: Type Checker
    • Labels:
      None

      Description

      The following code crashes typer:

      trait A[_]
      trait B[X] extends A[B[X @unchecked]] { this.x }
      

      A is not essential (any type constructor will do), neither is x (any name lookup in "this" suffices) nor unchecked (any annotation does the trick).

      The problem appears to be in Implicits.companionImplicitMap (at least that's where it manifests itself), with an endless recursion between getClassParts and getParts, called with types that appear to be the same but not identical. In the reproduction above, the bts as seen in getClassParts are always:

      bts(1) = A[B[... @... @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked @unchecked]]
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              szeiger Stefan Zeiger
            • Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated: