Skip to content

Implicit type conversion via static #valueOf method #4

Closed

Description

@amelentev

For be able to write

BigInteger a = 123

instead of

BigInteger a = BigInteger.valueOf(123)

Scala equivalent to:

implicit def intToBigInteger(x: Int) = BigInteger.valueOf(x)

Activity

  1. amelentev commented on Nov 17, 2012

    @amelentev
    OwnerAuthor

    This is already performed by javac for Integer, Double and other wrapper classes (boxing):

    Integer a = 123 
    

    transforms to

    Integer a = Integer.valueOf(123)
    
  2. added 2 commits that reference this issue on Nov 17, 2012
  3. added a commit that references this issue on Nov 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions