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

Initial Generics implementation (really basic) #166

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open

Initial Generics implementation (really basic) #166

wants to merge 37 commits into from

Conversation

edg-l
Copy link
Member

@edg-l edg-l commented Jan 30, 2025

mod MyMod {

    pub fn hello_generics<T>(x: T) -> T {
        return x;
    }

    pub fn main() -> i32 {
        let value: i32 = hello_generics::<i32>(4);

        return value;
    }
}

depends on #164

Fixes #168

Copy link

github-actions bot commented Jan 30, 2025

Benchmarking factorial

Compiling factorial (factorial.con)
Finished release in 29.263377ms
Running 5000000 iterations
Using input value: 20
Concrete Result = 2432902008176640000 Time taken : 59.32 ms
Rust Result = 2432902008176640000 Time taken : 60.39 ms

Benchmarking fib

Compiling fib (fib.con)
Finished release in 26.550399ms
Running 5000 iterations
Using input value: 20
Concrete Result = 6765 Time taken : 136.69 ms
Rust Result = 6765 Time taken : 85.63 ms

@codecov-commenter
Copy link

codecov-commenter commented Jan 30, 2025

Codecov Report

Attention: Patch coverage is 58.85714% with 72 lines in your changes missing coverage. Please review.

Project coverage is 62.99%. Comparing base (de0d968) to head (e03908a).

Files with missing lines Patch % Lines
src/ir/lowering/prepass.rs 23.07% 20 Missing ⚠️
src/check/mod.rs 0.00% 17 Missing ⚠️
src/ast/types.rs 0.00% 15 Missing ⚠️
src/ir/lowering.rs 87.62% 12 Missing ⚠️
src/ast/common.rs 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #166      +/-   ##
==========================================
- Coverage   64.12%   62.99%   -1.13%     
==========================================
  Files          21       21              
  Lines        4989     4970      -19     
==========================================
- Hits         3199     3131      -68     
- Misses       1790     1839      +49     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Base automatically changed from import_struct to main February 4, 2025 13:56
src/ir/lowering.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@juanbono juanbono left a comment

Choose a reason for hiding this comment

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

See comments

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.

Recursive generic functions loop infinitely
4 participants