New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
scabug opened this Issue Jan 17, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@scabug
Copy link

scabug commented Jan 17, 2017

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.

@scabug

This comment has been minimized.

Copy link

scabug commented Jan 17, 2017

Imported From: https://issues.scala-lang.org/browse/SI-10153?orig=1
Reporter: Espen Wiborg (espenhw)
Affected Versions: 2.11.8, 2.12.1
Attachments:

  • type-error.zip (created on Jan 17, 2017 11:20:59 AM UTC, 1516 bytes)

@scabug scabug added the typer label Apr 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment