This page is no longer maintained — Please continue to the home page at www.scala-lang.org

On more question about Type building

2 replies
David Pollak
Joined: 2008-12-16,
User offline. Last seen 42 years 45 weeks ago.

Folks,

Once I have a Symbol via getClass, how do I add a type parameter... so I can turn List into List[String]... and does <:< "do the right thing" for type parameters, variance, etc.?

Thanks,

David

Adriaan Moors
Joined: 2009-04-03,
User offline. Last seen 42 years 45 weeks ago.
Re: On more question about Type building


On Thu, Jun 11, 2009 at 3:50 PM, David Pollak <feeder.of.the.bears@gmail.com> wrote:

Folks,

Once I have a Symbol via getClass, how do I add a type parameter... so I can turn List into List[String]...

using appliedType(sym.tpeHK, args) (or sym.tpe -- it doesn't matter if you're going to apply it to type arguments rightaway) //  args : List[Type]

and does <:< "do the right thing" for type parameters, variance, etc.?

of course ;-) 
cheersadriaan

Thanks,

David


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm for more information.

David Pollak
Joined: 2008-12-16,
User offline. Last seen 42 years 45 weeks ago.
Re: On more question about Type building


On Thu, Jun 11, 2009 at 7:06 AM, Adriaan Moors <adriaan.moors@cs.kuleuven.be> wrote:


On Thu, Jun 11, 2009 at 3:50 PM, David Pollak <feeder.of.the.bears@gmail.com> wrote:

Folks,

Once I have a Symbol via getClass, how do I add a type parameter... so I can turn List into List[String]...

using appliedType(sym.tpeHK, args) (or sym.tpe -- it doesn't matter if you're going to apply it to type arguments rightaway) //  args : List[Type]

Awesome.
 

and does <:< "do the right thing" for type parameters, variance, etc.?

of course ;-) 

Cool and the gang!
 

cheersadriaan

Thanks,

David


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm for more information.




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland