v
v copied to clipboard
cgen error: could not generate string method `pthread_mutex_t_str` for type `pthread_mutex_t`
OS: macos, macOS, 12.5.1, 21G83 Processor: 8 cpus, 64bit, little endian, Intel(R) Core(TM) i7-8569U CPU @ 2.80GHz CC version: Apple clang version 13.1.6 (clang-1316.0.21.2.5)
getwd: /Users/shove/Projects/Temp/v/v_test_001 vmodules: /Users/shove/.vmodules vroot: /usr/local/v vexe: /usr/local/v/v vexe mtime: 2022-08-22 01:03:21 is vroot writable: true is vmodules writable: true V full version: V 0.3.0 0d9ac1f
Git version: git version 2.32.1 (Apple Git-133) Git vroot status: weekly.2022.33-46-g0d9ac1f5 .git/config present: true thirdparty/tcc status: thirdparty-macos-amd64 46662e20
What did you do?
import sync
struct Foo {
mutex &sync.Mutex
}
// fn (f &Foo) str() string {
// return 'Foo'
// }
fn main() {
foo := Foo{mutex: sync.new_mutex()}
println(foo)
}
What did you expect to see?
What did you see instead?
cgen error: could not generate string method `pthread_mutex_t_str` for type `pthread_mutex_t`
With the latest V commit, the above code compiles and gives the output:
Foo{
mutex: &sync.Mutex{
mutex: pthread_mutex_t{}
}
}
on macOS, The problem still exists. on Linux , OK
What is the issue with MacOs?
What is the issue with MacOs?
cgen error: could not generate string method pthread_mutex_t_str
for type pthread_mutex_t
Strange as it works on Linux for me

Yes, it's OK on Linux