goplus / llgo

A Go compiler based on LLVM in order to better integrate Go with the C ecosystem including Python
Apache License 2.0
323 stars 26 forks source link

ssa: fix llgo:type c for typeparam named #770

Closed visualfc closed 3 weeks ago

visualfc commented 3 weeks ago

fix llgo:type c for typeparams

package main

import (
    "unsafe"
)

type Func func(*int)

//llgo:type C
type CFunc func(*int)

//llgo:type C
type Callback[T any] func(*T)

func main() {
    var fn1 Func = func(v *int) {
        println(*v)
    }
    var fn2 CFunc = func(v *int) {
        println(*v)
    }
    var fn3 Callback[int] = func(v *int) {
        println(*v)
    }
    println(unsafe.Sizeof(fn1), unsafe.Sizeof(fn2), unsafe.Sizeof(fn3))
}
codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.53%. Comparing base (3ce9567) to head (b0ebb47). Report is 14 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #770 +/- ## ======================================= Coverage 97.53% 97.53% ======================================= Files 19 19 Lines 4667 4671 +4 ======================================= + Hits 4552 4556 +4 Misses 97 97 Partials 18 18 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.