Scala Compiler2.13.0 < Back


# Packages

-  package root

  The Scala compiler and reflection APIs.

  The Scala compiler and reflection APIs.

  Definition Classes
    root
-  package scala
  Definition Classes
    root
-  package tools
  Definition Classes
    scala
-  package nsc
  Definition Classes
    tools
-  package typechecker
  Definition Classes
    nsc
- Adaptations
- Analyzer
- AnalyzerPlugins
- Checkable
- ConstantFolder
- ContextErrors
- ContextMode
- Contexts
- DestructureTypes
- Duplicators
- EtaExpansion
- Fingerprint
- Implicits
- ImplicitsStats
- Infer
- MacroAnnotationAttachments
- MacroAnnotationNamers
- Macros
- MacrosStats
- MethodSynthesis
- Namers
- NamesDefaults
- PatternTypers
- RefChecks
- StdAttachments
- StructuredTypeStrings
- SuperAccessors
- SyntheticMethods
- Tags
- TreeCheckers
- TypeDiagnostics
- TypeStrings
- Typers
- TypersStats
- TypersTracking
- Unapplies

t

scala.tools.nsc.typechecker

# Implicits

###

#### trait Implicits extends AnyRef

This trait provides methods to find various kinds of implicits.

Self Type
  Analyzer
Source
  Implicits.scala
Version

  1.0

Linear Supertypes
AnyRef, Any
Known Subclasses
erasure, treeChecker, ScaladocAnalyzer, InteractiveAnalyzer, Erasure, Duplicator, SpecializationDuplicator, Analyzer, Duplicators, TreeCheckers
Type Hierarchy

Ordering

1. Alphabetic
2. By Inheritance

Inherited

1. Implicits
2. AnyRef
3. Any

Implicitly

1. by any2stringadd
2. by StringFormat
3. by Ensuring
4. by ArrowAssoc

1. Hide All
2. Show All

Visibility

1. Public
2. All

### Type Members

1.  class ImplicitAnnotationMsg extends AnyRef
2.  class ImplicitInfo extends AnyRef

   A class that records an available implicit

3.  class ImplicitSearch extends Analyzer.Typer with Analyzer.ImplicitsContextErrors

   A class that sets up an implicit search.

   A class that sets up an implicit search. For more info, see comments for `inferImplicit`.

4.  class Message extends AnyRef
5.  case class OpenImplicit(info: Analyzer.ImplicitInfo, pt: Global.Type, tree: Global.Tree) extends Product with Serializable

   A class which is used to track pending implicits to prevent infinite implicit searches.

6.  class SearchResult extends AnyRef

   The result of an implicit search

### Value Members

1.  final def !=(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
2.  final def ##(): Int
   Definition Classes
     AnyRef → Any
3.  def +(other: String): String
   Implicit
     This member is added by an implicit conversion from Implicits toany2stringadd[Implicits] performed by method any2stringadd in scala.Predef.
   Definition Classes
     any2stringadd
4.  def ->[B](y: B): (Implicits, B)
   Implicit
     This member is added by an implicit conversion from Implicits toArrowAssoc[Implicits] performed by method ArrowAssoc in scala.Predef.
   Definition Classes
     ArrowAssoc
   Annotations
     @inline()
5.  final def ==(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
6.  lazy val AmbiguousSearchFailure: Analyzer.SearchResult
7.  lazy val DivergentSearchFailure: Analyzer.SearchResult
8.  val NoImplicitInfo: Analyzer.ImplicitInfo

   A sentinel indicating no implicit was found

9.  lazy val SearchFailure: Analyzer.SearchResult
10.  def SearchedPrefixImplicitInfo(pre: Global.Type): Analyzer.ImplicitInfo
11.  def allViewsFrom(tp: Global.Type, context: Analyzer.Context, tpars: List[Global.Symbol]): List[(Analyzer.SearchResult, List[Global.TypeConstraint])]

    Find all views from type `tp` (in which `tpars` are free)

    Find all views from type `tp` (in which `tpars` are free)

    Note that the trees in the search results in the returned list share the same type variables. Ignore their constr field! The list of type constraints returned along with each tree specifies the constraints that must be met by the corresponding type parameter in `tpars` (for the returned implicit view to be valid).

    tp

      from-type for the implicit conversion

    context

      search implicits here

    tpars

      symbols that should be considered free type variables (implicit search should not try to solve them, just track their constraints)

12.  final def asInstanceOf[T0]: T0
    Definition Classes
      Any
13.  def clone(): AnyRef
    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws(classOf[java.lang.CloneNotSupportedException]) @native()
14.  def ensuring(cond: (Implicits) => Boolean, msg: => Any): Implicits
    Implicit
      This member is added by an implicit conversion from Implicits toEnsuring[Implicits] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring
15.  def ensuring(cond: (Implicits) => Boolean): Implicits
    Implicit
      This member is added by an implicit conversion from Implicits toEnsuring[Implicits] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring
16.  def ensuring(cond: Boolean, msg: => Any): Implicits
    Implicit
      This member is added by an implicit conversion from Implicits toEnsuring[Implicits] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring
17.  def ensuring(cond: Boolean): Implicits
    Implicit
      This member is added by an implicit conversion from Implicits toEnsuring[Implicits] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring
18.  final def eq(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
19.  def equals(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef → Any
20.  def finalize(): Unit
    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws(classOf[java.lang.Throwable])
21.  def formatted(fmtstr: String): String
    Implicit
      This member is added by an implicit conversion from Implicits toStringFormat[Implicits] performed by method StringFormat in scala.Predef.
    Definition Classes
      StringFormat
    Annotations
      @inline()
22.  final def getClass(): Class[_ <: AnyRef]
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
23.  def hashCode(): Int
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
24.  def inferImplicit(tree: Global.Tree, pt: Global.Type, isView: Boolean, context: Analyzer.Context, silent: Boolean, withMacrosDisabled: Boolean, pos: Global.Position, onError: (Global.Position, String) => Unit): Global.Tree

    A friendly wrapper over inferImplicit to be used in macro contexts and toolboxes.

25.  def inferImplicit(tree: Global.Tree, pt: Global.Type, reportAmbiguous: Boolean, isView: Boolean, context: Analyzer.Context, saveAmbiguousDivergent: Boolean, pos: Global.Position): Analyzer.SearchResult

    Search for an implicit value.

    Search for an implicit value. Consider using one of the convenience methods above. This one has many boolean levers.

    See the comment on `result` at the end of class `ImplicitSearch` for more info how the search is conducted.

    tree

      The tree for which the implicit needs to be inserted. (the inference might instantiate some of the undetermined type parameters of that tree.

    pt

      The expected type of the implicit.

    reportAmbiguous

      Should ambiguous implicit errors be reported? False iff we search for a view to find out whether one type is coercible to another.

    isView

      We are looking for a view

    context

      The current context

    saveAmbiguousDivergent

      False if any divergent/ambiguous errors should be ignored after implicits search, true if they should be reported (used in further typechecking).

    pos

      Position that should be used for tracing and error reporting (useful when we infer synthetic stuff and pass EmptyTree in the `tree` argument) If it's set to NoPosition, then position-based services will use `tree.pos`

    returns

      A search result

26.  def inferImplicitByType(pt: Global.Type, context: Analyzer.Context, pos: Global.Position = NoPosition): Analyzer.SearchResult
27.  def inferImplicitByTypeSilent(pt: Global.Type, context: Analyzer.Context, pos: Global.Position = NoPosition): Analyzer.SearchResult
28.  def inferImplicitFor(pt: Global.Type, tree: Global.Tree, context: Analyzer.Context, reportAmbiguous: Boolean = true): Analyzer.SearchResult
29.  def inferImplicitView(from: Global.Type, to: Global.Type, tree: Global.Tree, context: Analyzer.Context, reportAmbiguous: Boolean, saveAmbiguousDivergent: Boolean): Analyzer.SearchResult
30.  final def isInstanceOf[T0]: Boolean
    Definition Classes
      Any
31.  def memberWildcardType(name: Global.Name, tp: Global.Type): Global.Type

    A constructor for types ?{ def/type name: tp }, used in infer view to member searches.

32.  final def ne(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
33.  final def notify(): Unit
    Definition Classes
      AnyRef
    Annotations
      @native()
34.  final def notifyAll(): Unit
    Definition Classes
      AnyRef
    Annotations
      @native()
35.  def resetImplicits(): Unit
36.  final def synchronized[T0](arg0: => T0): T0
    Definition Classes
      AnyRef
37.  def toString(): String
    Definition Classes
      AnyRef → Any
38.  final def wait(): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws(classOf[java.lang.InterruptedException])
39.  final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws(classOf[java.lang.InterruptedException])
40.  final def wait(arg0: Long): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws(classOf[java.lang.InterruptedException]) @native()
41.  object Function1

    An extractor for unary function types arg => res

42.  object HasMember

    An extractor for types of the form ? { name: ? }

43.  object HasMethodMatching

    An extractor for types of the form ? { name: (? >: argtpe <: Any*)restp }

44.  object ImplicitAmbiguousMsg extends Analyzer.ImplicitAnnotationMsg
45.  object ImplicitNotFoundMsg extends Analyzer.ImplicitAnnotationMsg
46.  object OpenImplicit extends java.io.Serializable
47.  object Shadower

### Deprecated Value Members

1.  def inferImplicit(tree: Global.Tree, pt: Global.Type, reportAmbiguous: Boolean, isView: Boolean, context: Analyzer.Context, saveAmbiguousDivergent: Boolean): Analyzer.SearchResult
   Annotations
     @deprecated
   Deprecated

     (Since version 2.12.0-M4) Unused in scalac

2.  def inferImplicit(tree: Global.Tree, pt: Global.Type, reportAmbiguous: Boolean, isView: Boolean, context: Analyzer.Context): Analyzer.SearchResult
   Annotations
     @deprecated
   Deprecated

     (Since version 2.12.0-M4) Unused in scalac

3.  def →[B](y: B): (Implicits, B)
   Implicit
     This member is added by an implicit conversion from Implicits toArrowAssoc[Implicits] performed by method ArrowAssoc in scala.Predef.
   Definition Classes
     ArrowAssoc
   Annotations
     @deprecated
   Deprecated

     (Since version 2.13.0) Use `->` instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

### Inherited from AnyRef

### Inherited from Any

### Inherited by implicit conversion any2stringadd fromImplicits to any2stringadd[Implicits]

### Inherited by implicit conversion StringFormat fromImplicits to StringFormat[Implicits]

### Inherited by implicit conversion Ensuring fromImplicits to Ensuring[Implicits]

### Inherited by implicit conversion ArrowAssoc fromImplicits to ArrowAssoc[Implicits]

### Ungrouped