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

Weird scala.reflect.internal.Types$TypeError: type mismatch

    Details

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

      Description

      The following code

      package test
       
      import java.net.URI
      import org.springframework.http.HttpMethod
      import org.springframework.http.client.ClientHttpRequestFactory
      import org.springframework.web.client._
       
      class RetryingRestTemplate(f: ClientHttpRequestFactory)
          extends RestTemplate(f) {
       
        override protected def doExecute[T](
            url: URI,
            method: HttpMethod,
            requestCallback: RequestCallback,
            responseExtractor: ResponseExtractor[T]): T = {
          defer {
            super.doExecute(url, method, requestCallback, responseExtractor)
          }
        }
       
        private def defer[T](thunk: => T): T = thunk
      }
      

      Crashes the compiler with

      scala.reflect.internal.Types$TypeError: type mismatch;
       found   : RetryingRestTemplate.super.type (with underlying type org.springframework.web.client.RestTemplate)
       required: test.RetryingRestTemplate
      

      Reproduced with both 2.11.8 and 2.12.1.

      Attached is an SBT project exhibiting the problem, minified as far as I am able.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              espenhw Espen Wiborg
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: