Skip to content

Three bugs caught by FindBugs #4459

Closed
Closed
@sir-wabbit

Description

@sir-wabbit

Using pointer equality to compare different types

val receiverIsSuper = (method.name eq sym) && enclosingClass.appliedRef.widen <:< recvWiden

on line 276 in dotty.tools.dotc.transform.TailRec

Self comparison of value with itself

  private class Set3[+Elem <: AnyRef](x0: AnyRef, x1: AnyRef, x2: AnyRef) extends SimpleIdentitySet[Elem] {
    def size = 3
    def + [E >: Elem <: AnyRef](x: E): SimpleIdentitySet[E] =
      if (contains(this)) this // <---- WAT
      else {

on line 62 of dotty.tools.dotc.util.SimpleIdentitySet

Method ignores return value

    val boundsText = domainLambdas
      " bounds = " + {
        val assocs =
          for (param <- domainParams)
          yield
            param.binder.paramNames(param.paramNum) + ": " + entryText(entry(param))
        assocs.mkString("\n")
    }

in dotty.tools.dotc.core.OrderingConstraint, line 639

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions