Skip to content

Instantly share code, notes, and snippets.

@xeno-by
Created September 1, 2013 09:30
Show Gist options
  • Save xeno-by/6403305 to your computer and use it in GitHub Desktop.
Save xeno-by/6403305 to your computer and use it in GitHub Desktop.
11:29 ~$ parse 'val x: Int => Int = ???'
[[syntax trees at end of parser]]// Scala source: tmp7pDKqZ
package <empty> {
class wrapper extends scala.AnyRef {
def <init>() = {
super.<init>();
()
};
val x: _root_.scala.Function1[Int, Int] = $qmark$qmark$qmark
}
}
PackageDef(Ident(newTermName("<empty>")), List(ClassDef(Modifiers(), newTypeName("wrapper"), List(), 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(())))), ValDef(Modifiers(), newTermName("x"), AppliedTypeTree(Select(Select(Ident(nme.ROOTPKG), scala), newTypeName("Function1")), List(Ident(newTypeName("Int")), Ident(newTypeName("Int")))), Ident(newTermName("$qmark$qmark$qmark"))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment