Creating a sortedSet function

For purposes of creating a sortedSet() function, I'm interested in why

this works

``

  inline fun sortedSet<T>(vararg values: T) : TreeSet<T> = values.to(TreeSet<T>(HashSet<T>((values.size))))

but this does not work

``

  inline fun sortedSet<T>(vararg values: T) : TreeSet<T> = values.to(TreeSet<T>(values.size))


The latter IDE view is captured in the attached screenshot.



[treeset.png|attachment](upload://lceGaACbumd5c5ga0IcLSmiUAAz.png) (135 KB)

TreeSet has no constructor that takes a single integer...

Ugh.  You're right.  I see it.  One day I will see when I look.