diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2007-04-16 11:48:04 +0000 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2007-04-16 11:48:04 +0000 |
commit | f0cde59118cb35a702c58b0c6ddddbc6552ecb1f (patch) | |
tree | 92afc9f8487bb89c6f5a086c6ce029674898059c | |
parent | 24eb581d805653215fce5f931f78789e31924800 (diff) | |
download | scala-f0cde59118cb35a702c58b0c6ddddbc6552ecb1f.tar.gz scala-f0cde59118cb35a702c58b0c6ddddbc6552ecb1f.tar.bz2 scala-f0cde59118cb35a702c58b0c6ddddbc6552ecb1f.zip |
"fixed" bug 1040, re-opened as 1046
tcpoly_parseridioms no longer uses exotic method names -- exoticnames.scala is a dedicated test that I feel should pass (it doesn't)
-rw-r--r-- | test/files/run/tcpoly_parseridioms.scala | 10 | ||||
-rw-r--r-- | test/pending/run/exoticnames.check | 0 | ||||
-rw-r--r-- | test/pending/run/exoticnames.scala | 7 |
3 files changed, 12 insertions, 5 deletions
diff --git a/test/files/run/tcpoly_parseridioms.scala b/test/files/run/tcpoly_parseridioms.scala index e163ea2ce8..0e2512f5bc 100644 --- a/test/files/run/tcpoly_parseridioms.scala +++ b/test/files/run/tcpoly_parseridioms.scala @@ -66,18 +66,18 @@ trait Idioms { } // TODO: `.` --> java.lang.ClassFormatError: Illegal method name "." in class Idioms$IdiomaticTarget class IdiomaticFunction[idi[x], idiom <: Idiom[idi], s, t](i: idiom, fun: s => t) { - def `(` (a: idi[s]) = new IdiomaticApp[idi, idiom, t](i, i.liftedApply(i.pure(fun))(a)) + def <| (a: idi[s]) = new IdiomaticApp[idi, idiom, t](i, i.liftedApply(i.pure(fun))(a)) } class IdiomaticApp[idi[x], idiom <: Idiom[idi], x](i: idiom, a: idi[x]) { // where x <: s=>t -- TODO can this be expressed without generalised constraints? - def `,` [s, t](b: idi[s]) = new IdiomaticApp[idi, idiom, t](i, i.liftedApply(a.asInstanceOf[idi[s=>t]])(b)) + def <> [s, t](b: idi[s]) = new IdiomaticApp[idi, idiom, t](i, i.liftedApply(a.asInstanceOf[idi[s=>t]])(b)) - def `)` : idi[x] = a + def |> : idi[x] = a } class IdiomaticApp2[idi[x], idiom <: Idiom[idi], x](i: idiom, a: idi[x]) extends IdiomaticApp[idi, idiom, x](i, a) { - def `(` [s, t](b: idi[s]) = `,`[s,t](b) + def <| [s, t](b: idi[s]) = <>[s,t](b) } } @@ -98,7 +98,7 @@ trait ParserIdioms extends Parsers with Idioms { def num = or(accept('0', 0), or(accept('1', 1),accept('2', 2))) // TODO: how can parserIdiom(curry2(_)) be omitted? - def expr: Parser[Expr] = parserIdiomFun(curry2(Plus)) `(` num `,` num `)` + def expr: Parser[Expr] = parserIdiomFun(curry2(Plus)) <| num <> num |> implicit def curry2[s,t,u](fun: (s, t)=>u)(a: s)(b: t) = fun(a, b) implicit def curry3[r,s,t,u](fun: (r,s, t)=>u)(a: r)(b: s)(c: t) = fun(a, b, c) diff --git a/test/pending/run/exoticnames.check b/test/pending/run/exoticnames.check new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/pending/run/exoticnames.check diff --git a/test/pending/run/exoticnames.scala b/test/pending/run/exoticnames.scala new file mode 100644 index 0000000000..7c8dcea5e8 --- /dev/null +++ b/test/pending/run/exoticnames.scala @@ -0,0 +1,7 @@ +// this is a run-test because the compiler should emit bytecode that'll pass the JVM's verifier +object Test extends Application { + def `(` = error("bla") + def `.` = error("bla") + def `)` = error("bla") + def `,` = error("bla") +}
\ No newline at end of file |