Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show::to_string is enough #1243

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion builtin/builtin.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,6 @@ impl FixedArray {
set[T](Self[T], Int, T) -> Unit
set_utf16_char(Self[Byte], Int, Char) -> Int
to_json[X : ToJson](Self[X]) -> Json
to_string[X : Show](Self[X]) -> String
unsafe_blit[A](Self[A], Int, Self[A], Int, Int) -> Unit
}

Expand Down
7 changes: 4 additions & 3 deletions builtin/fixedarray.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ pub fn iter2[T](self : FixedArray[T]) -> Iter2[Int, T] {
}

///|
pub fn to_string[X : Show](self : FixedArray[X]) -> String {
Show::to_string(self)
}
// pub fn to_string[X : Show](self : FixedArray[X]) -> String {
// // Show::to_string(self)
// self.to_string() // this may cause nonterminated recursion
// }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is actually non-terminating, we may detect this cc @Yu-zh


///|
pub fn FixedArray::default[X]() -> FixedArray[X] {
Expand Down