Skip to content

Commit

Permalink
Specify underlying types of opaque types
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Jan 19, 2024
1 parent a6bbc97 commit 5b8be3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fury
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ project aviation
module core
compiler scala
sources src/core
include eucalyptus/core cardinality/core kaleidoscope/core quantitative/core hypotenuse/core
include eucalyptus/core cardinality/core kaleidoscope/core quantitative/core hypotenuse/core anticipation/opaque

module test
compiler scala
Expand Down
3 changes: 3 additions & 0 deletions src/core/time.scala
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ object Dates:
opaque type Date = Int

object Date:
erased given underlying: Underlying[Date, Int] = ###
def of(day: Int): Date = day

def apply
Expand Down Expand Up @@ -201,12 +202,14 @@ object Timing:
opaque type TaiInstant = Long

object TaiInstant:
erased given underlying: Underlying[TaiInstant, Long] = ###
given generic: GenericInstant[Timing.TaiInstant] with
def instant(millisecondsSinceEpoch: Long): Timing.TaiInstant = millisecondsSinceEpoch
def millisecondsSinceEpoch(instant: Timing.TaiInstant): Long = instant


object Instant:
erased given underlying: Underlying[Instant, Long] = ###
def of(millis: Long): Instant = millis

given generic: GenericInstant[Timing.Instant] with
Expand Down

0 comments on commit 5b8be3e

Please sign in to comment.