mirror of
https://github.com/unisonweb/unison.git
synced 2024-10-05 22:27:28 +03:00
disgust
- revert scalaVersion from 2.12.6 to 2.12.4 because `1.0 until ...` is deprecated in 2.12.6 - recommended workaround is to use BigDecimal ranges, but this shallow fix caused a ClassCastException - revert sbt to 0.13.17 because unlike local sbt, Travis CI's sbt doesn't know how to self-upgrade to 1.1.x - add implicit syntax for `Int => UInt64` ; our existing `Int => Term` implicit produces `Int64`.
This commit is contained in:
parent
41497a1240
commit
763bd3a750
@ -14,7 +14,7 @@ lazy val commonSettings = Seq(
|
||||
//"-XX:LiveNodeCountInliningCutoff"
|
||||
),
|
||||
organization := "org.unisonweb",
|
||||
scalaVersion := "2.12.6",
|
||||
scalaVersion := "2.12.4",
|
||||
scalacOptions ++= Seq(
|
||||
"-feature",
|
||||
"-deprecation",
|
||||
|
@ -477,9 +477,17 @@ object Term {
|
||||
def apply(args: Term*) = Apply(fn, args: _*)
|
||||
}
|
||||
|
||||
implicit class IntegerSyntax(val i: Int) extends AnyVal {
|
||||
def unsigned: Term = Unboxed(intToUnboxed(i), UnboxedType.UInt64)
|
||||
}
|
||||
|
||||
implicit class LongSyntax(val l: Long) extends AnyVal {
|
||||
def unsigned: Term = Unboxed(longToUnboxed(l), UnboxedType.UInt64)
|
||||
}
|
||||
|
||||
implicit def bool(b: Boolean): Term = Unboxed(boolToUnboxed(b), UnboxedType.Boolean)
|
||||
implicit def number(n: Long): Term = Unboxed(longToUnboxed(n), UnboxedType.Int64)
|
||||
implicit def number(n: Int): Term = Unboxed(intToUnboxed(n), UnboxedType.Int64)
|
||||
implicit def signed(n: Long): Term = Unboxed(longToUnboxed(n), UnboxedType.Int64)
|
||||
implicit def signed(n: Int): Term = Unboxed(intToUnboxed(n), UnboxedType.Int64)
|
||||
implicit def double(n: Double): Term = Unboxed(doubleToUnboxed(n), UnboxedType.Float)
|
||||
implicit def stringAsText(s: String): Term = Text(util.Text.fromString(s))
|
||||
implicit def nameAsVar(s: Name): Term = Var(s)
|
||||
|
@ -354,13 +354,13 @@ object CompilationTests {
|
||||
ok
|
||||
},
|
||||
test("ex1") { implicit T =>
|
||||
equal(eval(Sequence.size(Sequence(1,2,3))), 3: Term)
|
||||
equal(eval(Sequence.size(Sequence(1,2,3))), 3.unsigned)
|
||||
},
|
||||
test("ex2 (underapplication)") { implicit T =>
|
||||
val t: Term =
|
||||
Let('x -> Sequence(1,2,3),
|
||||
'fn -> Sequence.take(2))(Sequence.size('fn.v('x)))
|
||||
equal(eval(t), 2: Term)
|
||||
equal(eval(t), 2.unsigned)
|
||||
}
|
||||
),
|
||||
suite("text") (
|
||||
|
@ -1 +1 @@
|
||||
sbt.version=1.1.2
|
||||
sbt.version=0.13.17
|
||||
|
Loading…
Reference in New Issue
Block a user