Skip to content

Commit

Permalink
Refactor conditions
Browse files Browse the repository at this point in the history
We special completion on qualifiers of type Nothing to not return the method on Any.
Also special case completion on qualifiers of type Null to not return completion that involves implicit conversions.
  • Loading branch information
nicolasstucki committed Jan 21, 2019
1 parent c85bc8e commit 4a55c5a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions compiler/src/dotty/tools/dotc/interactive/Completion.scala
Expand Up @@ -210,13 +210,9 @@ object Completion {
* considered.
*/
def addMemberCompletions(qual: Tree)(implicit ctx: Context): Unit = {
if (qual.tpe =:= defn.NothingType)
()
else if (qual.tpe.isRef(defn.NullClass))
addAccessibleMembers(defn.AnyRefType)
else {
if (!qual.tpe.widenDealias.isBottomType) {
addAccessibleMembers(qual.tpe)
if (!mode.is(Mode.Import)) {
if (!mode.is(Mode.Import) && !qual.tpe.isRef(defn.NullClass)) {
// Implicit conversions do not kick in when importing
implicitConversionTargets(qual)(ctx.fresh.setExploreTyperState())
.foreach(addAccessibleMembers)
Expand Down

0 comments on commit 4a55c5a

Please sign in to comment.