Improved instance method resolution logic and added test for Decimal overloading.
This commit is contained in:
1 parent
286ec30422
commit
cdd48ec871
2 files changed
+18
-2
No files matched your search
@@ -295,4 +295,17 @@ class DecimalModuleTest {
|
||||
|
||||
assertEquals(2, ex.pos.line)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testOverloading() = runTest {
|
||||
eval("""
|
||||
import lyng.decimal
|
||||
assert( 1.d is Decimal )
|
||||
assertEquals(Decimal, abs(1.d)::class)
|
||||
// here the inference must work:
|
||||
val t = abs(-10.d)
|
||||
assert(t is Decimal)
|
||||
assertEquals(10,t)
|
||||
""".trimIndent())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user