Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"value MAX_EXPONENT is not a member of object Double", but autocompletion says otherwise #7978

Closed
scabug opened this issue Nov 18, 2013 · 3 comments
Assignees
Labels
Milestone

Comments

@scabug
Copy link

scabug commented Nov 18, 2013

Below, the autocompletion of REPL suggests that Double.MAX_EXPONENT exists, but this generates an error at bottom.

EDIT: forgot to bracket code correctly.

    cd ; PATH=~/jdk1.7.0_45/bin:~/scala-2.10.3/bin:$PATH scala 
    Welcome to Scala version 2.10.3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_45).
    Type in expressions to have them evaluated.
    Type :help for more information.

    scala> var e:Double=1
    e: Double = 1.0
{code}Then the workaround suggested #7418:{code}
    scala> e.<TabAutoComplete, the workaround suggested https://issues.scala-lang.org/browse/SI-7418>
    %              *              +              -              /              >              >=             asInstanceOf   isInstanceOf   toByte         toChar         toDouble       toFloat        toInt          toLong         toShort        toString       unary_+        unary_-        

Then the autocompletion

    scala> Double.<TabAutoComplete, which generates the bug>
    MaxValue              MinPositiveValue      MinValue              NaN                   NegativeInfinity      PositiveInfinity      asInstanceOf          box                   isInstanceOf          toString              unbox                 MAX_EXPONENT          MAX_VALUE             MIN_EXPONENT          
    MIN_NORMAL            MIN_VALUE             NEGATIVE_INFINITY     POSITIVE_INFINITY     SIZE                  TYPE                  compare               doubleToLongBits      doubleToRawLongBits   isInfinite            isNaN                 longBitsToDouble      parseDouble           toHexString           
    valueOf               

And the use, in disagreement with autocompletion

    scala> Double.MAX_EXPONENT
     <console>:8: error: value MAX_EXPONENT is not a member of object Double
              Double.MAX_EXPONENT
                     ^

I wanted to translate eps from matlab, in which eps is the minimal Double that can be added to 1.0, when I found this bug.

@scabug
Copy link
Author

scabug commented Nov 18, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7978?orig=1
Reporter: Scaal (scaal)
Affected Versions: 2.10.3

@scabug
Copy link
Author

scabug commented Sep 15, 2015

@soc said:
The issue is that Scala imports everything in java.lang.*, but shadows things in many cases with their own types in scala._, and then gets confused about which things are accessible.

@scabug
Copy link
Author

scabug commented Feb 24, 2016

@som-snytt said:
This is fixed by new completion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants