Skip to content

value tailLabel does not take parameters #1614

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

Closed
olafurpg opened this issue Oct 19, 2016 · 2 comments
Closed

value tailLabel does not take parameters #1614

olafurpg opened this issue Oct 19, 2016 · 2 comments
Assignees

Comments

@olafurpg
Copy link
Contributor

Trying to compile scalastyle with dotty at commit: matthewfarwell/scalastyle@92b81e0

I get the compiler error:

error: value tailLabel624 does not take parameters

Running with -Ycheck:all and -Ycheck:firstTransform I get the following error:

[trace] Stack trace suppressed: run last compile:compileIncremental for the full output.
[error] (compile:compileIncremental) java.lang.AssertionError: assertion failed: error at /Users/ollie/dev/scalastyle/src/main/scala/org/scalastyle/Checker.scala:184
[error] type mismatch:
[error]  found   : Array[Class[_]]
[error]  required: Class[_]
[error] tree = Typed(JavaSeqLiteral(List(), TypeTree[RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,lang)),Class), java$lang$Class$$T, TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,scala)),Nothing), TypeRef(ThisType(TypeRef(NoPrefix,scala)),Any)))]),TypeTree[RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,scala)),Array), scala$Array$$T, TypeAlias(RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,lang)),Class), java$lang$Class$$T, TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,scala)),Nothing), TypeRef(ThisType(TypeRef(NoPrefix,scala)),Any))), 0))])

linking to this line in Checker.scala:

      val c: Checker[_] = clazz.getConstructor().newInstance().asInstanceOf[Checker[_]]

Removing the block containing that line I get the original "taillabel does not take parameters" error instead of "type mismatch" when compiled with -Ycheck:all.

Any hints on how to better debug this?

@matthewfarwell
Copy link

This is a minimized example, which fails in dotr:

object Foobar {
  def apply(): Option[String] = { 
    def foobar[A](f: (String, String) => A): List[A] = List[String]() match { 
      case _ :: ls => foobar(f) 
    } 
    foobar((a1, a2) => (a1 + a2)).headOption 
  } 
}

@DarkDimius
Copy link
Contributor

@matthewfarwell, was able to reproduce. Thank you!

DarkDimius added a commit to dotty-staging/dotty that referenced this issue Oct 23, 2016
@DarkDimius DarkDimius self-assigned this Oct 23, 2016
felixmulder added a commit that referenced this issue Oct 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants