ITADN

thunk errors point at the signature, not at the callee

#7199Openzygoloid 创建于 2026-05-13
Z
zygoloidcommented
[Example](https://godbolt.org/z/j673P99h3): ```carbon interface I { fn F(n: i32); } impl () as I { fn F(n: i16) {} } ``` produces ```console <source>:2:8: error: cannot implicitly convert expression of type `i32` to `i16` fn F(n: i32); ^~~~~~ <source>:2:8: note: type `i32` does not implement interface `Core.ImplicitAs(i16)` fn F(n: i32); ^~~~~~ <source>:6:8: note: initializing function parameter fn F(n: i16) {} ^~~~~~ <source>:2:3: note: while building thunk to match the signature of this function fn F(n: i32); ^~~~~~~~~~~~~ ``` Note that the primary error points to the declaration in the `interface`. It would be more helpful if the primary location of the error message pointed at the callee of the thunk.
0 条评论