Skip to content

Instantly share code, notes, and snippets.

@wheaties
Created December 3, 2015 21:35
Show Gist options
  • Select an option

  • Save wheaties/fdbb13dd015dfd2d1051 to your computer and use it in GitHub Desktop.

Select an option

Save wheaties/fdbb13dd015dfd2d1051 to your computer and use it in GitHub Desktop.
Exports
2.10.6 (not working)
______
object Triple extends LowerPriorityTriple {
def <init>() = {
super.<init>();
()
};
object exports extends scala.AnyRef {
def <init>() = {
super.<init>();
()
};
import scala.language.experimental.macros;
implicit <macro> def tpedefns$Triple$anonimplicit$0[$35$[$36$, $37$, $38$] >: tpedefns.this.Triple[$36$, $37$, $38$], $39$ >: _root_.scala.Nothing <: _root_.scala.Any, $40$ >: _root_.scala.Nothing <: _root_.scala.Any, $41$ >: _root_.scala.Nothing <: _root_.scala.Any]: export.this.Export5[$35$[$39$, $40$, $41$]] = _root_.export.ExportsImplExpr.exportsImpl000[tpedefns.this.Triple, $39$, $40$, $41$, export.this.Export5];
implicit def tpedefns$Triple$anonimplicit$2: export.this.Export5[<type ?>] = new export.this.Export5[<type ?>](iii)
};
def apply[A >: _root_.scala.Nothing <: _root_.scala.Any, B >: _root_.scala.Nothing <: _root_.scala.Any, C >: _root_.scala.Nothing <: _root_.scala.Any](implicit trp: Triple[A, B, C]) = trp;
@new export() implicit def iii = {
final class $anon extends Triple[Int, Int, Int] {
def <init>() = {
super.<init>();
()
};
def describe: String = "Triple[Int, Int, Int]"
};
new $anon()
}
}
2.11.7
______
object Triple extends LowerPriorityTriple {
def <init>() = {
super.<init>();
()
};
object exports extends scala.AnyRef {
def <init>() = {
super.<init>();
()
};
import scala.language.experimental.macros;
implicit <macro> def tpedefns$Triple$anonimplicit$0[fresh$macro$731[fresh$macro$732, fresh$macro$733, fresh$macro$734] >: tpedefns.this.Triple[fresh$macro$732, fresh$macro$733, fresh$macro$734], fresh$macro$735, fresh$macro$736, fresh$macro$737]: export.this.Export5[fresh$macro$731[fresh$macro$735, fresh$macro$736, fresh$macro$737]] = _root_.export.ExportsImplExpr.exportsImpl000[tpedefns.this.Triple, fresh$macro$735, fresh$macro$736, fresh$macro$737, export.this.Export5];
implicit def tpedefns$Triple$anonimplicit$2: export.this.Export5[<type ?>] = new export.this.Export5[<type ?>](iii)
};
def apply[A, B, C](implicit trp: Triple[A, B, C]) = trp;
@new export() implicit def iii = {
final class $anon extends Triple[Int, Int, Int] {
def <init>() = {
super.<init>();
()
};
def describe: String = "Triple[Int, Int, Int]"
};
new $anon()
}
}
++++++
2.10.6 (not working)
______
ModuleDef(Modifiers(), newTermName("Triple"), Template(List(Ident(newTypeName("LowerPriorityTriple"))), emptyValDef, List(DefDef(Modifiers(), nme.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(Apply(Select(Super(This(tpnme.EMPTY), tpnme.EMPTY), nme.CONSTRUCTOR), List())), Literal(Constant(())))), ModuleDef(Modifiers(), newTermName("exports"), Template(List(Select(Ident(scala), newTypeName("AnyRef"))), emptyValDef, List(DefDef(Modifiers(), nme.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(Apply(Select(Super(This(tpnme.EMPTY), tpnme.EMPTY), nme.CONSTRUCTOR), List())), Literal(Constant(())))), Import(Select(Select(Ident(newTermName("scala")), newTermName("language")), newTermName("experimental")), List(ImportSelector(newTermName("macros"), -1, newTermName("macros"), -1))), DefDef(Modifiers(IMPLICIT | MACRO), newTermName("tpedefns$Triple$anonimplicit$0"), List(TypeDef(Modifiers(PARAM), newTypeName("$35$"), List(TypeDef(Modifiers(PARAM), newTypeName("$36$"), List(), TypeBoundsTree(EmptyTree, EmptyTree)), TypeDef(Modifiers(PARAM), newTypeName("$37$"), List(), TypeBoundsTree(EmptyTree, EmptyTree)), TypeDef(Modifiers(PARAM), newTypeName("$38$"), List(), TypeBoundsTree(EmptyTree, EmptyTree))), TypeBoundsTree(AppliedTypeTree(Select(This(newTypeName("tpedefns")), tpedefns.Triple), List(Ident(newTypeName("$36$")), Ident(newTypeName("$37$")), Ident(newTypeName("$38$")))), EmptyTree)), TypeDef(Modifiers(PARAM), newTypeName("$39$"), List(), TypeBoundsTree(Select(Select(Ident(nme.ROOTPKG), newTermName("scala")), newTypeName("Nothing")), Select(Select(Ident(nme.ROOTPKG), newTermName("scala")), newTypeName("Any")))), TypeDef(Modifiers(PARAM), newTypeName("$40$"), List(), TypeBoundsTree(Select(Select(Ident(nme.ROOTPKG), newTermName("scala")), newTypeName("Nothing")), Select(Select(Ident(nme.ROOTPKG), newTermName("scala")), newTypeName("Any")))), TypeDef(Modifiers(PARAM), newTypeName("$41$"), List(), TypeBoundsTree(Select(Select(Ident(nme.ROOTPKG), newTermName("scala")), newTypeName("Nothing")), Select(Select(Ident(nme.ROOTPKG), newTermName("scala")), newTypeName("Any"))))), List(), AppliedTypeTree(Select(This(newTypeName("export")), export.Export5), List(AppliedTypeTree(Ident(newTypeName("$35$")), List(Ident(newTypeName("$39$")), Ident(newTypeName("$40$")), Ident(newTypeName("$41$")))))), TypeApply(Select(Select(Select(Ident(nme.ROOTPKG), newTermName("export")), newTermName("ExportsImplExpr")), newTermName("exportsImpl000")), List(Select(This(newTypeName("tpedefns")), tpedefns.Triple), Ident(newTypeName("$39$")), Ident(newTypeName("$40$")), Ident(newTypeName("$41$")), Select(This(newTypeName("export")), export.Export5)))), DefDef(Modifiers(IMPLICIT), newTermName("tpedefns$Triple$anonimplicit$2"), List(), List(), AppliedTypeTree(Select(This(newTypeName("export")), export.Export5), List(TypeTree())), Apply(Select(New(AppliedTypeTree(Select(This(newTypeName("export")), export.Export5), List(TypeTree()))), nme.CONSTRUCTOR), List(Ident(newTermName("iii")))))))), DefDef(Modifiers(), newTermName("apply"), List(TypeDef(Modifiers(PARAM), newTypeName("A"), List(), TypeBoundsTree(Select(Select(Ident(nme.ROOTPKG), scala), newTypeName("Nothing")), Select(Select(Ident(nme.ROOTPKG), scala), newTypeName("Any")))), TypeDef(Modifiers(PARAM), newTypeName("B"), List(), TypeBoundsTree(Select(Select(Ident(nme.ROOTPKG), scala), newTypeName("Nothing")), Select(Select(Ident(nme.ROOTPKG), scala), newTypeName("Any")))), TypeDef(Modifiers(PARAM), newTypeName("C"), List(), TypeBoundsTree(Select(Select(Ident(nme.ROOTPKG), scala), newTypeName("Nothing")), Select(Select(Ident(nme.ROOTPKG), scala), newTypeName("Any"))))), List(List(ValDef(Modifiers(IMPLICIT | PARAM), newTermName("trp"), AppliedTypeTree(Ident(newTypeName("Triple")), List(Ident(newTypeName("A")), Ident(newTypeName("B")), Ident(newTypeName("C")))), EmptyTree))), TypeTree(), Ident(newTermName("trp"))), DefDef(Modifiers(IMPLICIT, tpnme.EMPTY, List(Apply(Select(New(Ident(newTypeName("export"))), nme.CONSTRUCTOR), List()))), newTermName("iii"), List(), List(), TypeTree(), Block(List(ClassDef(Modifiers(FINAL), newTypeName("$anon"), List(), Template(List(AppliedTypeTree(Ident(newTypeName("Triple")), List(Ident(newTypeName("Int")), Ident(newTypeName("Int")), Ident(newTypeName("Int"))))), emptyValDef, List(DefDef(Modifiers(), nme.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(Apply(Select(Super(This(tpnme.EMPTY), tpnme.EMPTY), nme.CONSTRUCTOR), List())), Literal(Constant(())))), DefDef(Modifiers(), newTermName("describe"), List(), List(), Ident(newTypeName("String")), Literal(Constant("Triple[Int, Int, Int]"))))))), Apply(Select(New(Ident(newTypeName("$anon"))), nme.CONSTRUCTOR), List()))))))
2.11.7 (working)
______
ModuleDef(Modifiers(), TermName("Triple"), Template(List(Ident(TypeName("LowerPriorityTriple"))), noSelfType, List(DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(pendingSuperCall), Literal(Constant(())))), ModuleDef(Modifiers(), TermName("exports"), Template(List(Select(Ident(scala), TypeName("AnyRef"))), noSelfType, List(DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(pendingSuperCall), Literal(Constant(())))), Import(Select(Select(Ident(TermName("scala")), TermName("language")), TermName("experimental")), List(ImportSelector(TermName("macros"), -1, TermName("macros"), -1))), DefDef(Modifiers(IMPLICIT | MACRO), TermName("tpedefns$Triple$anonimplicit$0"), List(TypeDef(Modifiers(PARAM), TypeName("fresh$macro$731"), List(TypeDef(Modifiers(PARAM), TypeName("fresh$macro$732"), List(), TypeBoundsTree(EmptyTree, EmptyTree)), TypeDef(Modifiers(PARAM), TypeName("fresh$macro$733"), List(), TypeBoundsTree(EmptyTree, EmptyTree)), TypeDef(Modifiers(PARAM), TypeName("fresh$macro$734"), List(), TypeBoundsTree(EmptyTree, EmptyTree))), TypeBoundsTree(AppliedTypeTree(Select(This(TypeName("tpedefns")), tpedefns.Triple), List(Ident(TypeName("fresh$macro$732")), Ident(TypeName("fresh$macro$733")), Ident(TypeName("fresh$macro$734")))), EmptyTree)), TypeDef(Modifiers(PARAM), TypeName("fresh$macro$735"), List(), TypeBoundsTree(EmptyTree, EmptyTree)), TypeDef(Modifiers(PARAM), TypeName("fresh$macro$736"), List(), TypeBoundsTree(EmptyTree, EmptyTree)), TypeDef(Modifiers(PARAM), TypeName("fresh$macro$737"), List(), TypeBoundsTree(EmptyTree, EmptyTree))), List(), AppliedTypeTree(Select(This(TypeName("export")), export.Export5), List(AppliedTypeTree(Ident(TypeName("fresh$macro$731")), List(Ident(TypeName("fresh$macro$735")), Ident(TypeName("fresh$macro$736")), Ident(TypeName("fresh$macro$737")))))), TypeApply(Select(Select(Select(Ident(termNames.ROOTPKG), TermName("export")), TermName("ExportsImplExpr")), TermName("exportsImpl000")), List(Select(This(TypeName("tpedefns")), tpedefns.Triple), Ident(TypeName("fresh$macro$735")), Ident(TypeName("fresh$macro$736")), Ident(TypeName("fresh$macro$737")), Select(This(TypeName("export")), export.Export5)))), DefDef(Modifiers(IMPLICIT), TermName("tpedefns$Triple$anonimplicit$2"), List(), List(), AppliedTypeTree(Select(This(TypeName("export")), export.Export5), List(TypeTree())), Apply(Select(New(AppliedTypeTree(Select(This(TypeName("export")), export.Export5), List(TypeTree()))), termNames.CONSTRUCTOR), List(Ident(TermName("iii")))))))), DefDef(Modifiers(), TermName("apply"), List(TypeDef(Modifiers(PARAM), TypeName("A"), List(), TypeBoundsTree(EmptyTree, EmptyTree)), TypeDef(Modifiers(PARAM), TypeName("B"), List(), TypeBoundsTree(EmptyTree, EmptyTree)), TypeDef(Modifiers(PARAM), TypeName("C"), List(), TypeBoundsTree(EmptyTree, EmptyTree))), List(List(ValDef(Modifiers(IMPLICIT | PARAM), TermName("trp"), AppliedTypeTree(Ident(TypeName("Triple")), List(Ident(TypeName("A")), Ident(TypeName("B")), Ident(TypeName("C")))), EmptyTree))), TypeTree(), Ident(TermName("trp"))), DefDef(Modifiers(IMPLICIT, typeNames.EMPTY, List(Apply(Select(New(Ident(TypeName("export"))), termNames.CONSTRUCTOR), List()))), TermName("iii"), List(), List(), TypeTree(), Block(List(ClassDef(Modifiers(FINAL), TypeName("$anon"), List(), Template(List(AppliedTypeTree(Ident(TypeName("Triple")), List(Ident(TypeName("Int")), Ident(TypeName("Int")), Ident(TypeName("Int"))))), noSelfType, List(DefDef(Modifiers(), termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(pendingSuperCall), Literal(Constant(())))), DefDef(Modifiers(), TermName("describe"), List(), List(), Ident(TypeName("String")), Literal(Constant("Triple[Int, Int, Int]"))))))), Apply(Select(New(Ident(TypeName("$anon"))), termNames.CONSTRUCTOR), List()))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment