Giter VIP home page Giter VIP logo

Comments (1)

rditerwich avatar rditerwich commented on June 28, 2024

Hi debasishg,

You are correct, it seems a bit odd. It stems from the fact that a
Map[K,V] extends form Iterable[Tuple2[K,V]]

So, the question is: how many type arguments does the addressesType
have (addressType.arguments.size)? 1 or 2?

We chose 1: the tuple containing the actual key van value types. This
is the only way to ensure compatibility with Iterable.

When matching a map type, you won't see this. Both of the following
case statements would match:

addressPropertyDesc.scalaType match {
case IterableType(Tuple2Type(k, v)) =>
case MapType(k, v) =>
}

I'm inclined just to change the toString of MapType. This would 'fix'
your example, but is entirely cosmetic...

Kind regards,

Ruud Diterwich

On Tue, May 17, 2011 at 9:25 AM, debasishg
[email protected]
wrote:

I have a class as ..

case class ContactWithOptionalAddr(name: String, addresses: Option[Map[String, Address]])

When I do a

import org.scalastuff.scalabeans.Preamble._
val descriptor = descriptorOf[ContactWithOptionalAddr]
for (property <- descriptor.properties)
   println(property.name + ": " + property.scalaType)

I get ..

name: String
addresses: Option[Map[Tuple2[String,Address]]]

which is not correct .. the Tuple2 I mean .. help ?

Reply to this email directly or view it on GitHub:
#1

from scalabeans.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.