• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

OpShin / opshin / 43578114251
93%

Build:
DEFAULT BRANCH: dev
Ran 14 Nov 2026 09:16AM UTC
Jobs 0
Files 0
Run time –
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
43578114251

push

github

web-flow
Add missing return type annotations to std/math.py ceil() and floor() (#648)

`opshin/std/math.py` exports `ceil` and `floor` without return type
annotations, while every other function in the module is annotated
(`gcd`, `sign`, `unsigned_int_from_bytes_big`, `bytes_big_from_unsigned_int`,
`and_bytestring`). Without the annotation the compiler infers `Any` for the
call result, and `Any` implements no operators, so every ordinary way of
consuming the value is rejected at compile time:

    from opshin.std.math import *

    def validator(a: int, b: int) -> int:
        return floor(a, b)

    CompilerError: Function annotated return type does not match actual
    return type, expected int but got Any

This affects comparisons, arithmetic, bool()/int() coercion, indexing,
and passing the value to an annotated parameter. The only form that works
is an explicitly annotated local (`r: int = floor(a, b)`), which is not
documented anywhere.

The existing tests in `tests/test_std/test_math.py` call the plain Python
functions via `from opshin.std import math as oc_math`, so the compiled
call path was never exercised and the missing annotation went unnoticed.

Changes:
- annotate `ceil` and `floor` with `-> int`
- add regression tests that compile and evaluate both functions through
  `tests.utils.eval_uplc_value`, including negative operands

Verified: the two new tests fail with the CompilerError above before the
annotation is added, and pass after.
Source Files on build 43578114251
Detailed source file information is not available for this build.
  • Back to Repo
  • 9353152a on github
  • Prev Build on dev (#33481548364)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc