circe / circe-yaml

YAML parser for circe using SnakeYAML
Apache License 2.0
141 stars 51 forks source link

Can't call io.circe.yaml.parser.parse on an input stream reader in 0.15.1 #410

Open Thrillpool opened 9 months ago

Thrillpool commented 9 months ago

If you try to do

io.circe.yaml.parser.parse(new InputStreamReader(null))

Then you get a compilation error

type mismatch;
 found   : java.io.InputStreamReader
 required: String

I would imagine this change to be responsible https://github.com/circe/circe-yaml/commit/d3d090719d4d7aa99b4d6cb0610cf49fca7cb455#diff-f063ea063fa1652fe54e2ad024f6209661708310bfbaf78c7b303fbc7095db2aR12

Though I don't see all the details.

If you replace io.circe.yaml.parser.parse with Parser.default.parse i.e. its definition, it compiles fine.

Edit - I think issue is basically this

object X extends App {
  B.f(0)
}

trait A {
  def f(x: String): String
}

package object B extends A {
  def f(x: Int): String = ???
  def f(x: String): String = ???
}

Edit - I suppose it's pertinent to say I am using scala 2.12

mmvpm commented 4 months ago

the same for scala-2.13.13 and circe-yaml-1.15.0