com.lorandszakacs.enclosure
package com.lorandszakacs.enclosure
Members list
Packages
Type members
Classlikes
When generated by the macro com.lorandszakacs.enclosure.Enclosure.generateEnclosure, this class provides information about the "enclosing scope" from where it was generated.
When generated by the macro com.lorandszakacs.enclosure.Enclosure.generateEnclosure, this class provides information about the "enclosing scope" from where it was generated.
Value parameters
- fullModuleName
-
Where "module" is either a:
class
object
package Examples:
package myapp import com.lorandszakacs.enclosure.Enclosure object Printer { def locatedPrintln(s: String)(implicit enc: Enclosure): Unit = { println(s"[{enc.fullModuleName}] $$s") } } // package myapp.module object Main extends App { myapp.Printer("in main!") // prints out: // [myapp.module.Main] in main! nestedMethod() // idem def nestedMethod(): Unit = { myapp.Printer("in main!") } }
if the Enclosure is generated:
within a nested class, that is also included in the fullModuleName.
within a package (object) the name will be the package name
Attributes
- Companion
- object
- Source
- Enclosure.scala
- Supertypes
object Enclosure extends EnclosureMacros
Attributes
- Companion
- class
- Source
- Enclosure.scala
- Supertypes
- Self type
-
Enclosure.type
In this article