diff options
author | Lukas Rytz <lukas.rytz@typesafe.com> | 2015-03-23 10:27:42 +0100 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@typesafe.com> | 2015-03-23 10:27:42 +0100 |
commit | 917602cd706a9e44d347ba2f58c0c63ccab8746c (patch) | |
tree | d577150a9f0ba3d6af851aa746678c6741efced3 | |
parent | 9149cc9c720b2cfc2432fc79cac75bc7ac80ba56 (diff) | |
parent | 004a1d6d841ceca31df77eead22659a54ddaa851 (diff) | |
download | scala-917602cd706a9e44d347ba2f58c0c63ccab8746c.tar.gz scala-917602cd706a9e44d347ba2f58c0c63ccab8746c.tar.bz2 scala-917602cd706a9e44d347ba2f58c0c63ccab8746c.zip |
Merge pull request #4241 from kanielc/SI-6778
SI-6778 scala.math.random should have parenthesis
-rw-r--r-- | src/library/scala/math/package.scala | 2 | ||||
-rw-r--r-- | test/files/pos/t6778.scala | 5 | ||||
-rw-r--r-- | test/files/run/analyzerPlugins.check | 8 |
3 files changed, 11 insertions, 4 deletions
diff --git a/src/library/scala/math/package.scala b/src/library/scala/math/package.scala index 58ece8a05b..b6593d6661 100644 --- a/src/library/scala/math/package.scala +++ b/src/library/scala/math/package.scala @@ -26,7 +26,7 @@ package object math { /** Returns a `double` value with a positive sign, greater than or equal * to `0.0` and less than `1.0`. */ - def random: Double = java.lang.Math.random() + def random(): Double = java.lang.Math.random() def sin(x: Double): Double = java.lang.Math.sin(x) def cos(x: Double): Double = java.lang.Math.cos(x) diff --git a/test/files/pos/t6778.scala b/test/files/pos/t6778.scala new file mode 100644 index 0000000000..b7483c8fce --- /dev/null +++ b/test/files/pos/t6778.scala @@ -0,0 +1,5 @@ +object test extends AnyRef with App { + // Check that random can be called with parenthesis. + scala.math.random() +} + diff --git a/test/files/run/analyzerPlugins.check b/test/files/run/analyzerPlugins.check index 9803465ddc..1bb7c6ceab 100644 --- a/test/files/run/analyzerPlugins.check +++ b/test/files/run/analyzerPlugins.check @@ -19,7 +19,7 @@ canAdaptAnnotations(Trees$Typed, Any) [1] canAdaptAnnotations(Trees$Typed, Int) [1] lub(List(Int @testAnn, Int)) [1] pluginsPt(?, Trees$Annotated) [7] -pluginsPt(?, Trees$Apply) [8] +pluginsPt(?, Trees$Apply) [11] pluginsPt(?, Trees$ApplyImplicitView) [2] pluginsPt(?, Trees$Assign) [7] pluginsPt(?, Trees$Block) [4] @@ -31,7 +31,7 @@ pluginsPt(?, Trees$Literal) [16] pluginsPt(?, Trees$New) [5] pluginsPt(?, Trees$PackageDef) [1] pluginsPt(?, Trees$Return) [1] -pluginsPt(?, Trees$Select) [47] +pluginsPt(?, Trees$Select) [50] pluginsPt(?, Trees$Super) [2] pluginsPt(?, Trees$This) [20] pluginsPt(?, Trees$TypeApply) [3] @@ -93,6 +93,7 @@ pluginsTypeSigAccessor(value x) [1] pluginsTypeSigAccessor(value y) [1] pluginsTypeSigAccessor(variable count) [2] pluginsTyped( <: Int, Trees$TypeBoundsTree) [2] +pluginsTyped(()Double, Trees$Select) [6] pluginsTyped(()Object, Trees$Select) [1] pluginsTyped(()String, Trees$Ident) [1] pluginsTyped(()String, Trees$TypeApply) [1] @@ -112,7 +113,7 @@ pluginsTyped(<notype>, Trees$PackageDef) [1] pluginsTyped(<notype>, Trees$TypeDef) [1] pluginsTyped(<notype>, Trees$ValDef) [21] pluginsTyped(=> Boolean @testAnn, Trees$Select) [1] -pluginsTyped(=> Double, Trees$Select) [4] +pluginsTyped(=> Double, Trees$Select) [1] pluginsTyped(=> Int, Trees$Select) [5] pluginsTyped(=> Int, Trees$TypeApply) [1] pluginsTyped(=> String @testAnn, Trees$Select) [1] @@ -131,6 +132,7 @@ pluginsTyped(Boolean(false), Trees$Literal) [2] pluginsTyped(Boolean, Trees$Apply) [1] pluginsTyped(Boolean, Trees$Select) [4] pluginsTyped(Char('c'), Trees$Literal) [2] +pluginsTyped(Double, Trees$Apply) [3] pluginsTyped(Double, Trees$Select) [6] pluginsTyped(Int @testAnn, Trees$TypeTree) [2] pluginsTyped(Int @testAnn, Trees$Typed) [2] |