Skip to content

Conversation

Kaida-Amethyst
Copy link
Contributor

@Kaida-Amethyst Kaida-Amethyst commented Mar 12, 2025

To Support the code like following, mentioned in issue #1773 .

fn trig_sum[T: Floating + Add](x: T) -> T {
  x.sin() + x.cos()
}

fn main {
  let _ = trig_sum(1.0);
  let _ = trig_sum(1.0:Float);
}

TODO:

  • trait Add
  • trait Sub
  • trait Mul
  • trait Div
  • trait Mod
  • trait Neg
  • trait Floating (or other name?)
  • trait Integer? Or trait Signed and trait Unsigned? (need discussion).

Still working on it. Keep testing.

@coveralls
Copy link
Collaborator

coveralls commented Mar 13, 2025

Pull Request Test Coverage Report for Build 5684

Details

  • 0 of 8 (0.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.1%) to 92.521%

Changes Missing Coverage Covered Lines Changed/Added Lines %
builtin/bigint_nonjs.mbt 0 2 0.0%
builtin/byte.mbt 0 2 0.0%
int16/int16.mbt 0 2 0.0%
uint16/uint16.mbt 0 2 0.0%
Totals Coverage Status
Change from base Build 5680: -0.1%
Covered Lines: 6025
Relevant Lines: 6512

💛 - Coveralls

@Kaida-Amethyst Kaida-Amethyst force-pushed the abstract_ops branch 2 times, most recently from 48422b7 to 6c13cbb Compare March 13, 2025 02:35
@hackwaly
Copy link
Contributor

related #1798

@Kaida-Amethyst
Copy link
Contributor Author

Kaida-Amethyst commented Mar 17, 2025

related #1798

Looks great! I’m thinking it might not be the best fit for me to implement this feature since it touches on some core aspects of the library. 🙃

@Kaida-Amethyst Kaida-Amethyst deleted the abstract_ops branch June 24, 2025 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants