Skip to content

Instantly share code, notes, and snippets.

@SethTisue
Created June 26, 2017 23:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SethTisue/f574b3235c6e13d211ff91e6cb0c242e to your computer and use it in GitHub Desktop.
Save SethTisue/f574b3235c6e13d211ff91e6cb0c242e to your computer and use it in GitHub Desktop.
is this scala/bug#7234 or something else?
scala> trait T; class C[T2 <: T](val t: T2, b: Boolean = true, n: Int = 0)
defined trait T
defined class C
scala> val t = new T { }
t: T = $anon$1@f2a1813
scala> new C[t.type](t)
res0: C[<refinement>.type] = C@7645f03e
scala> new C[t.type](t, n = 1)
<console>:15: error: type mismatch;
found : T
required: <refinement>.type
Error occurred in an application involving default arguments.
new C[t.type](t, n = 1)
^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment