Skip to content

Commit

Permalink
internal: update to pub(readonly) trait & tweak ci (#72)
Browse files Browse the repository at this point in the history
* update to pub(readonly) trait

* tweak ci
  • Loading branch information
Young-Flash authored Nov 12, 2024
1 parent 0a692f9 commit d12cee1
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 53 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ jobs:
moon version --all
moonrun --version
- name: moon test
run: |
moon test --target all --serial --release
moon test --target all --serial
moon test --target native --release
moon test --target native
- name: moon check
run: moon check --deny-warn

Expand All @@ -54,13 +61,6 @@ jobs:
moon info
git diff --exit-code
- name: moon test
run: |
moon test --target all --serial --release
moon test --target all --serial
moon test --target native --release
moon test --target native
- name: format diff
run: |
moon fmt
Expand Down
2 changes: 0 additions & 2 deletions benchmark/benchmark.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,3 @@ impl TaskResult {

// Traits

// Extension Methods

2 changes: 0 additions & 2 deletions benchmark/internal/ffi/ffi.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ type Instant

// Traits

// Extension Methods

2 changes: 0 additions & 2 deletions crypto/crypto.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,3 @@ impl Sha256Context {

// Traits

// Extension Methods

4 changes: 1 addition & 3 deletions fs/fs.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ fn write_string_to_file(~path : String, ~content : String) -> Unit
pub type! IOError {
NotFound(String)
}
impl Show for IOError

// Type aliases

// Traits

// Extension Methods
impl Show for IOError

2 changes: 0 additions & 2 deletions fs/internal/ffi/ffi.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,3 @@ fn write_string_to_file(String, String) -> Unit

// Traits

// Extension Methods

6 changes: 3 additions & 3 deletions json5/json5.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub enum ParseErrorData {
impl ParseErrorData {
op_equal(Self, Self) -> Bool
}
impl Eq for ParseErrorData

pub struct Position {
pub line : Int
Expand All @@ -28,11 +29,10 @@ impl Position {
op_equal(Self, Self) -> Bool
to_string(Self) -> String
}
impl Eq for Position
impl Show for Position

// Type aliases

// Traits

// Extension Methods
impl Show for Position

2 changes: 1 addition & 1 deletion num/num.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

pub trait Num {
pub(readonly) trait Num {
from_int(Int) -> Self
op_add(Self, Self) -> Self
op_sub(Self, Self) -> Self
Expand Down
4 changes: 1 addition & 3 deletions num/num.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package moonbitlang/x/num
// Type aliases

// Traits
pub trait Num {
pub(readonly) trait Num {
from_int(Int) -> Self
op_add(Self, Self) -> Self
op_sub(Self, Self) -> Self
Expand All @@ -18,5 +18,3 @@ pub trait Num {
signum(Self) -> Self
}

// Extension Methods

3 changes: 1 addition & 2 deletions stack/stack.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ impl Stack {
to_string[T : Show](Self[T]) -> String
unsafe_pop[T](Self[T]) -> T
}
impl[T : Default] Default for Stack[T]

// Type aliases

// Traits

// Extension Methods

38 changes: 19 additions & 19 deletions time/time.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ impl Duration {
with_seconds(Self, Int64) -> Self
zero() -> Self
}
impl Compare for Duration
impl Eq for Duration
impl Show for Duration

type Period
impl Period {
Expand Down Expand Up @@ -62,6 +65,9 @@ impl Period {
years(Self) -> Int
zero() -> Self
}
impl Compare for Period
impl Eq for Period
impl Show for Period

type PlainDate
impl PlainDate {
Expand Down Expand Up @@ -96,6 +102,7 @@ impl PlainDate {
with_year(Self, Int) -> Self!
year(Self) -> Int
}
impl Show for PlainDate

type PlainDateTime
impl PlainDateTime {
Expand Down Expand Up @@ -143,6 +150,9 @@ impl PlainDateTime {
with_year(Self, Int) -> Self!
year(Self) -> Int
}
impl Compare for PlainDateTime
impl Eq for PlainDateTime
impl Show for PlainDateTime

type PlainTime
impl PlainTime {
Expand Down Expand Up @@ -171,6 +181,9 @@ impl PlainTime {
with_nanosecond(Self, Int) -> Self!
with_second(Self, Int) -> Self!
}
impl Compare for PlainTime
impl Eq for PlainTime
impl Show for PlainTime

pub enum Weekday {
Monday
Expand All @@ -185,13 +198,17 @@ impl Weekday {
op_equal(Self, Self) -> Bool
to_string(Self) -> String
}
impl Eq for Weekday
impl Show for Weekday

type Zone
impl Zone {
is_fixed(Self) -> Bool
op_equal(Self, Self) -> Bool
to_string(Self) -> String
}
impl Eq for Zone
impl Show for Zone

type ZoneOffset
impl ZoneOffset {
Expand All @@ -204,6 +221,7 @@ impl ZoneOffset {
seconds(Self) -> Int
to_string(Self) -> String
}
impl Show for ZoneOffset

type ZonedDateTime
impl ZonedDateTime {
Expand Down Expand Up @@ -250,27 +268,9 @@ impl ZonedDateTime {
year(Self) -> Int
zone(Self) -> Zone
}
impl Show for ZonedDateTime

// Type aliases

// Traits

// Extension Methods
impl Show for Duration

impl Show for Period

impl Show for PlainDate

impl Show for PlainDateTime

impl Show for PlainTime

impl Show for Weekday

impl Show for Zone

impl Show for ZoneOffset

impl Show for ZonedDateTime

12 changes: 5 additions & 7 deletions uuid/uuid.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ impl UUID {
variant(Self) -> Variant
version(Self) -> Version?
}
impl Compare for UUID
impl Eq for UUID
impl Show for UUID

pub enum Variant {
ReservedNCS
Expand All @@ -27,6 +30,7 @@ pub enum Variant {
impl Variant {
to_string(Self) -> String
}
impl Show for Variant

pub enum Version {
V1
Expand All @@ -39,15 +43,9 @@ pub enum Version {
impl Version {
to_string(Self) -> String
}
impl Show for Version

// Type aliases

// Traits

// Extension Methods
impl Show for UUID

impl Show for Variant

impl Show for Version

0 comments on commit d12cee1

Please sign in to comment.