<commit_before>package dotty.tools.dotc
package transform

import core._
import Types._
import Contexts._
import Symbols._
import SymDenotations._
import Decorators._
import Names._
import StdNames._
import NameOps._
import Flags._
import language.implicitConversions

object SymUtils {
  implicit def decorateSymbol(sym: Symbol): SymUtils = new SymUtils(sym)
  implicit def decorateSymDenot(d: SymDenotation): SymUtils = new SymUtils(d.symbol)
}

/** A decorator that provides methods on symbols
 *  that are needed in the transformer pipeline.
 */
class SymUtils(val self: Symbol) extends AnyVal {
  import SymUtils._

  def superClass(implicit ctx: Context) = {
    val parents = self.asClass.classInfo.parents
    if (parents.isEmpty) NoSymbol
    else parents.head.symbol
  }

  /** All interfaces implemented by a class, except for those inherited through the superclass. */
  def mixins(implicit ctx: Context) = {
    val superCls = self.superClass
    if (self is Trait) Nil
    else {
      val baseClasses = self.asClass.baseClasses
      if (baseClasses.isEmpty) Nil
      else baseClasses.tail.takeWhile(_ ne superCls).reverse
    }
  }

  def isTypeTestOrCast(implicit ctx: Context): Boolean =
    self == defn.Any_asInstanceOf || self == defn.Any_isInstanceOf

  def isVolatile(implicit ctx: Context) = self.hasAnnotation(defn.VolatileAnnot)

  def isAnyOverride(implicit ctx: Context) = self.is(Override) || self.is(AbsOverride)
    // careful: AbsOverride is a term only flag. combining with Override would catch only terms.
<commit_msg>Untroduce SumUtils.superInterfaces which is different from mixins.<commit_after>package dotty.tools.dotc
package transform

import core._
import Types._
import Contexts._
import Symbols._
import SymDenotations._
import Decorators._
import Names._
import StdNames._
import NameOps._
import Flags._
import language.implicitConversions

object SymUtils {
  implicit def decorateSymbol(sym: Symbol): SymUtils = new SymUtils(sym)
  implicit def decorateSymDenot(d: SymDenotation): SymUtils = new SymUtils(d.symbol)
}

/** A decorator that provides methods on symbols
 *  that are needed in the transformer pipeline.
 */
class SymUtils(val self: Symbol) extends AnyVal {
  import SymUtils._

  def superClass(implicit ctx: Context) = {
    val parents = self.asClass.classInfo.parents
    if (parents.isEmpty) NoSymbol
    else parents.head.symbol
  }


  /**
   * For a class: All interfaces implemented by a class except for those inherited through the superclass.
   * For a trait: all parent traits
   */

  def superInterfaces(implicit ctx: Context) = {
    val superCls = self.superClass
    val baseClasses = self.asClass.baseClasses
    if (baseClasses.isEmpty) Nil
    else baseClasses.tail.takeWhile(_ ne superCls).reverse

  }

  /** All interfaces implemented by a class, except for those inherited through the superclass. */
  def mixins(implicit ctx: Context) = {
    if (self is Trait) Nil
    else superInterfaces
  }

  def isTypeTestOrCast(implicit ctx: Context): Boolean =
    self == defn.Any_asInstanceOf || self == defn.Any_isInstanceOf

  def isVolatile(implicit ctx: Context) = self.hasAnnotation(defn.VolatileAnnot)

  def isAnyOverride(implicit ctx: Context) = self.is(Override) || self.is(AbsOverride)
    // careful: AbsOverride is a term only flag. combining with Override would catch only terms.

{'fraction_non_alphanumeric': 0.08064037948413876, 'fraction_numerical': 0.0, 'mean_word_length': 4.073684210526316, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5098869', 'n_tokens_mistral': 998, 'n_tokens_neox': 978, 'n_words': 325}