diff options
author | Ingo Maier <ingo.maier@epfl.ch> | 2009-03-31 13:38:18 +0000 |
---|---|---|
committer | Ingo Maier <ingo.maier@epfl.ch> | 2009-03-31 13:38:18 +0000 |
commit | a464ed4c3a8cddc200e38e8882026eb1ca5de7d9 (patch) | |
tree | 9accc54853444fe64eeabb39f7562dd447855f41 | |
parent | 3b25ed4bb51947b86822be323ffdf808151cfc8d (diff) | |
download | scala-a464ed4c3a8cddc200e38e8882026eb1ca5de7d9.tar.gz scala-a464ed4c3a8cddc200e38e8882026eb1ca5de7d9.tar.bz2 scala-a464ed4c3a8cddc200e38e8882026eb1ca5de7d9.zip |
Removed all traces of ByNameFunction
5 files changed, 0 insertions, 54 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index c1c5e26d3d..cfa91371fc 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -722,13 +722,6 @@ trait Parsers extends NewScanners with MarkupParsers { if (inToken == RPAREN) { inNextToken atPos(accept(ARROW)) { makeFunctionTypeTree(List(), typ(isPattern)) } - /* Not more used - } else if (inToken == ARROW) { - inNextToken - val t0 = typ(isPattern) - accept(RPAREN) - atPos(accept(ARROW)) { makeByNameFunctionTypeTree(t0, typ(isPattern)) } - */ } else { val ts = types(isPattern, false, true) accept(RPAREN) diff --git a/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala b/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala index ee32434612..43a667f16c 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala @@ -426,12 +426,6 @@ abstract class TreeBuilder { def makeFunctionTypeTree(argtpes: List[Tree], restpe: Tree): Tree = AppliedTypeTree(scalaDot(newTypeName("Function" + argtpes.length)), argtpes ::: List(restpe)) - /** Create a tree representing a the name function type (=> argtpe) => restpe */ - /* - def makeByNameFunctionTypeTree(argtpe: Tree, restpe: Tree): Tree = - AppliedTypeTree(scalaDot(newTypeName("ByNameFunction")), List(argtpe, restpe)) - */ - /** Append implicit view section if for `implicitViews' if nonempty */ def addImplicitViews(owner: Name, vparamss: List[List[ValDef]], implicitViews: List[Tree]): List[List[ValDef]] = { val mods = Modifiers(if (owner.isTypeName) PARAMACCESSOR | LOCAL | PRIVATE else PARAM) diff --git a/src/compiler/scala/tools/nsc/symtab/Definitions.scala b/src/compiler/scala/tools/nsc/symtab/Definitions.scala index 4f2e07166f..188eeb8e49 100644 --- a/src/compiler/scala/tools/nsc/symtab/Definitions.scala +++ b/src/compiler/scala/tools/nsc/symtab/Definitions.scala @@ -103,9 +103,6 @@ trait Definitions { var CodeModule: Symbol = _ def Code_lift = getMember(CodeModule, nme.lift_) lazy val PartialFunctionClass: Symbol = getClass("scala.PartialFunction") - /* - lazy val ByNameFunctionClass: Symbol = getClass("scala.ByNameFunction") - */ lazy val IterableClass: Symbol = getClass2("scala.Iterable", "scala.collection.Iterable") def Iterable_next = getMember(IterableClass, nme.next) def Iterable_hasNext = getMember(IterableClass, nme.hasNext) diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala index f3c2bc3122..e793fb463a 100644 --- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala +++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala @@ -63,11 +63,6 @@ abstract class UnCurry extends InfoTransform with TypingTransformers { apply(MethodType(List(), restpe)) case PolyType(tparams, restpe) => PolyType(tparams, apply(MethodType(List(), restpe))) - /* - case TypeRef(pre, sym, List(arg1, arg2)) if (arg1.typeSymbol == ByNameParamClass) => - assert(sym == FunctionClass(1)) - apply(typeRef(pre, definitions.ByNameFunctionClass, List(expandAlias(arg1.typeArgs(0)), arg2))) - */ case TypeRef(pre, sym, List(arg)) if (sym == ByNameParamClass) => apply(functionType(List(), arg)) case TypeRef(pre, sym, args) if (sym == RepeatedParamClass) => @@ -620,13 +615,6 @@ abstract class UnCurry extends InfoTransform with TypingTransformers { assert(name != nme.WILDCARD_STAR.toTypeName) applyUnary(tree); case Select(qual, name) => - /* Function1.apply to ByNameFunction.apply if qualifier is a ByNameFunction */ - /* - if (qual.tpe.typeSymbol == ByNameFunctionClass) { - assert(tree.symbol.name == nme.apply && tree.symbol.owner == FunctionClass(1), tree.symbol) - tree.symbol = getMember(ByNameFunctionClass, nme.apply) - } - */ applyUnary(tree) case TypeApply(_, _) => applyUnary(tree) diff --git a/src/library/scala/ByNameFunction.scala b/src/library/scala/ByNameFunction.scala deleted file mode 100644 index a4fb553a4a..0000000000 --- a/src/library/scala/ByNameFunction.scala +++ /dev/null @@ -1,26 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2002-2009, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id$ - - -package scala - -/** A partial function of type <code>PartialFunction[A, B]</code> is a - * unary function where the domain does not include all values of type - * <code>A</code>. The function <code>isDefinedAt</code> allows to - * test dynamically, if a value is in the domain of the function. - * - * @author Martin Odersky - * @version 1.0, 16/07/2003 - */ -trait ByNameFunction[-A, +B] extends AnyRef { - def apply(x: => A): B - override def toString() = "<function>" -} - |