Scala路径依赖返回类型来自参数

Ric*_*ver 6 parameters scala path-dependent-type

在下面的代码中使用2.10.0M3在Eclipse插件2.1.0中为2.10M3.我正在使用针对JVM 1.5的默认设置

class GeomBase[T <: DTypes] {          
  abstract class NewObjs {
    def newHex(gridR: GridBase, coodI: Cood): gridR.HexRT          
  }

  class GridBase {
    selfGrid =>
      type HexRT = HexG with T#HexTr

    def uniformRect (init: NewObjs) {
      val hexCood = Cood(2 ,2)
      val hex: HexRT = init.newHex(selfGrid, hexCood)//  won't compile
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

错误信息:

Description Resource Path Location Type type mismatch;
  found: GeomBase.this.GridBase#HexG with T#HexTr
  required: GridBase.this.HexRT (which expands to) GridBase.this.HexG with T#HexTr GeomBase.scala   
Run Code Online (Sandbox Code Playgroud)

为什么编译器认为该方法返回类型投影GridBase#HexG应该是GridBase的这个特定实例?

编辑转移到更简单的代码类,以响应评论现在获得不同的错误消息.

package rStrat
class TestClass {
  abstract class NewObjs {
    def newHex(gridR: GridBase): gridR.HexG
  }     
  class GridBase {
    selfGrid =>         

    def uniformRect (init: NewObjs) {
      val hex: HexG = init.newHex(this) //error here                        
    }       

    class HexG {
      val test12 = 5                 
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

.

Error line 11:Description   Resource    Path    Location    Type
type mismatch;  found   : gridR.HexG  required: GridBase.this.HexG
possible cause: missing arguments for method or constructor TestClass.scala /SStrat/src/rStrat  line 11 Scala Problem
Run Code Online (Sandbox Code Playgroud)

更新我已切换到2.10.0M4并在新版Eclipse上将插件更新为M4版本并切换到JVM 1.6(和1.7),但问题没有改变.

Adr*_*ors 4

记录为SI-5958 - 将其替换为依赖方法类型