cgen: fix error for interface and embedded struct build (#13530)

pull/13545/head
yuyi 2022-02-20 02:43:40 +08:00 committed by GitHub
parent 67e33bf9bc
commit 09f08e1fee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View File

@ -5633,6 +5633,9 @@ static inline __shared__$interface_name ${shared_fn_name}(__shared__$cctype* x)
methods_wrapper.write_string('.$esym.embed_name()')
}
}
if fargs.len > 1 {
methods_wrapper.write_string(', ')
}
methods_wrapper.writeln('${fargs[1..].join(', ')});')
} else {
if parameter_name.starts_with('__shared__') {

View File

@ -0,0 +1,17 @@
pub struct Event {}
pub struct ViewBase {}
pub fn (vb ViewBase) point_inside(e Event) {}
pub struct ContainerBase {
ViewBase
}
interface Focusable {
point_inside(Event)
}
fn test_interface_and_embedded_struct_build() {
assert true
}