Skip to content

Commit 034c0be

Browse files
committed
Enable implicits to check completion enrichment
1 parent 9fc1356 commit 034c0be

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

src/interactive/scala/tools/nsc/interactive/Global.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,10 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "")
11061106
*/
11071107
def viewApply(view: SearchResult): Tree = {
11081108
assert(view.tree != EmptyTree)
1109-
analyzer.newTyper(context.makeImplicit(reportAmbiguousErrors = false))
1109+
val t = analyzer.newTyper(context.makeImplicit(reportAmbiguousErrors = false))
1110+
.typed(Apply(view.tree, List(tree)) setPos tree.pos)
1111+
if (!t.tpe.isErroneous) t
1112+
else analyzer.newTyper(context.makeSilent(reportAmbiguousErrors = true))
11101113
.typed(Apply(view.tree, List(tree)) setPos tree.pos)
11111114
.onTypeError(EmptyTree)
11121115
}

test/files/presentation/infix-completion.check

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ reload: Snippet.scala
33
askTypeCompletion at Snippet.scala(1,34)
44
================================================================================
55
[response] askTypeCompletion at (1,34)
6-
retrieved 192 members
6+
retrieved 211 members
77
[inaccessible] protected def integralNum: math.Numeric.DoubleAsIfIntegral.type
88
[inaccessible] protected def num: math.Numeric.DoubleIsFractional.type
99
[inaccessible] protected def ord: math.Ordering.Double.type
@@ -109,10 +109,16 @@ def ^(x: Short): Int
109109
def byteValue(): Byte
110110
def ceil: Double
111111
def compare(y: Double): Int
112+
def compare(y: Float): Int
113+
def compare(y: Int): Int
112114
def compare(y: Long): Int
113115
def compareTo(that: Double): Int
116+
def compareTo(that: Float): Int
117+
def compareTo(that: Int): Int
114118
def compareTo(that: Long): Int
115119
def compareTo(x$1: Double): Int
120+
def compareTo(x$1: Float): Int
121+
def compareTo(x$1: Integer): Int
116122
def compareTo(x$1: Long): Int
117123
def doubleValue(): Double
118124
def ensuring(cond: Boolean): Int
@@ -136,6 +142,10 @@ def round: Long
136142
def shortValue(): Short
137143
def to(end: Double): Range.Partial[Double,scala.collection.immutable.NumericRange[Double]]
138144
def to(end: Double,step: Double): scala.collection.immutable.NumericRange.Inclusive[Double]
145+
def to(end: Float): Range.Partial[Float,scala.collection.immutable.NumericRange[Float]]
146+
def to(end: Float,step: Float): scala.collection.immutable.NumericRange.Inclusive[Float]
147+
def to(end: Int): scala.collection.immutable.Range.Inclusive
148+
def to(end: Int,step: Int): scala.collection.immutable.Range.Inclusive
139149
def to(end: Long): scala.collection.immutable.NumericRange.Inclusive[Long]
140150
def to(end: Long,step: Long): scala.collection.immutable.NumericRange.Inclusive[Long]
141151
def toBinaryString: String
@@ -157,6 +167,10 @@ def unary_~: Int
157167
def underlying(): AnyRef
158168
def until(end: Double): Range.Partial[Double,scala.collection.immutable.NumericRange[Double]]
159169
def until(end: Double,step: Double): scala.collection.immutable.NumericRange.Exclusive[Double]
170+
def until(end: Float): Range.Partial[Float,scala.collection.immutable.NumericRange[Float]]
171+
def until(end: Float,step: Float): scala.collection.immutable.NumericRange.Exclusive[Float]
172+
def until(end: Int): scala.collection.immutable.Range
173+
def until(end: Int,step: Int): scala.collection.immutable.Range
160174
def until(end: Long): scala.collection.immutable.NumericRange.Exclusive[Long]
161175
def until(end: Long,step: Long): scala.collection.immutable.NumericRange.Exclusive[Long]
162176
def |(x: Byte): Int
@@ -185,8 +199,12 @@ override def isValidInt: Boolean
185199
override def isValidShort: Boolean
186200
override def isWhole(): Boolean
187201
override def max(that: Double): Double
202+
override def max(that: Float): Float
203+
override def max(that: Int): Int
188204
override def max(that: Long): Long
189205
override def min(that: Double): Double
206+
override def min(that: Float): Float
207+
override def min(that: Int): Int
190208
override def min(that: Long): Long
191209
override def signum: Int
192210
private[this] val self: Double

0 commit comments

Comments
 (0)