Skip to content

Bad indentation parsing at code misalignment #8256

Closed
@soronpo

Description

@soronpo

minimized code

Important! Keep the indentation as set in this example.

val a = 1

  trait Test[A]
  object Test {
    implicit def ev[A] : Test[A] = new Test[A]{}
  }

  val fetch = implicitly[Test[1]]

@main def main() : Unit = {}

See scastie: https://scastie.scala-lang.org/Ixn7YUAZSjSCPgKbNQR5Wg

Compilation output

no implicit argument of type Test[(1 : Int)] was found for parameter ev of method implicitly in object DottyPredef

The following import might fix the problem:

  import Test.this.Test.ev

expectation

No error.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions