Compiling code like this:
class Outer1 {
class Inner()
def makeInner(): Inner = new Inner()
}
class Outer2 {
def myFunc(o: Outer1) = o.makeInner()
}
I get an error like this:
scala> class Outer2 {
| def myFunc(o: Outer1) = o.makeInner()
| }
<console>:7: error: illegal dependent method type
def myFunc(o: Outer1) = o.makeInner()
^
Google reveals that this is known and that the compile option "-Ydependent-method-types" will make it go away. But it appears to have been "experimental" for a number of years, and that suggests that it is not about to become a supported feature any time soon.
Should I be working about this problem, or using -Ydependent-method-types?
Cheers,
Will :-}
P.S. While looking through "scala -Y" I found "-Yno-completion". Is there any easy way to make that a default option? e.g. is there a .scalarc I could add it to? A SCALA_OPTS environment variable?
Hi all,
Compiling code like this:
class Outer1 {
class Inner()
def makeInner(): Inner = new Inner()
}
class Outer2 {
def myFunc(o: Outer1) = o.makeInner()
}
I get an error like this:
scala> class Outer2 {
| def myFunc(o: Outer1) = o.makeInner()
| }
<console>:7: error: illegal dependent method type
def myFunc(o: Outer1) = o.makeInner()
^
-------- Original-Nachricht --------
> Datum: Fri, 18 Feb 2011 11:01:35 +0100
> Von: Adriaan Moors <adriaa...@epfl.ch>
> An: scala...@googlegroups.com
> Betreff: Re: [scala-user] illegal dependent method type?
-------- Original-Nachricht --------
> Datum: Fri, 18 Feb 2011 12:15:52 +0100
> Von: Adriaan Moors <adriaa...@epfl.ch>
> An: Dennis Haupt <h-s...@gmx.de>
> CC: scala...@googlegroups.com
> Betreff: Re: [scala-user] illegal dependent method type?
> Hi Dennis,
>
> I'd love to hear the limitations you ran into! Please have a look at our
> oopsla paper, "Type Classes as
> <http://ropas.snu.ac.kr/~bruno/papers/TypeClasses.pdf>
> *Objects <http://ropas.snu.ac.kr/~bruno/papers/TypeClasses.pdf>* and
> <http://ropas.snu.ac.kr/~bruno/papers/TypeClasses.pdf>
> *Implicits <http://ropas.snu.ac.kr/~bruno/papers/TypeClasses.pdf>" for
> some
> examples of combining dependent method types and implicits.*
>
> **cheers
didn't look at the papers yet. who came up with that name?