scala.tools.refactoring.analysis.ImportsToolbox
Returns true
if an import has been found for tested Select
and false
otherwise.
Returns true
if an import has been found for tested Select
and false
otherwise.
Note: the examples below assume that b
in val baz: b
produces TypeTree
which is
converted to Select
. So examples are just a visualization of potential use case.
Examples:
trait A { import a.b def foo = { val baz: b = ??? } }
returns true
def foo = { import a.b val baz: b = ??? }
returns true
but
def foo = { val baz: b = ??? import a.b }
returns false
For more see tests suites.
Checks if for given
Select
potentially done fromTypeTree
exists import (represented byImport
) in thisSelect
scope or its parent.