title: How can I create an instance of projected type in Scala?
body: <p>I use Type Projection. You can find in the example below a type alias.</p>
  
  <pre><code>object Example extends App {
    type AliasForY = X#Y
  
    class X {
      class Y {
        def fun = 100500
      }
    }
  
    def f(y: AliasForY) = y.fun
  
    println {
      f(new AliasForY())
    }
  
  }
  </code></pre>
  
  <p>I want to instantiate my inner class via alias, but I get an error <code>Example.X is not a legal prefix for a constructor</code>.</p>
  
  <p>How can I fix it?</p>