diff options
Diffstat (limited to 'src/codegen/mod.rs')
-rw-r--r-- | src/codegen/mod.rs | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index 79e63de6..0ddcdc0a 100644 --- a/src/codegen/mod.rs +++ b/src/codegen/mod.rs @@ -614,14 +614,20 @@ impl CodeGenerator for Type { .resolve(ctx); let name = item.canonical_name(ctx); - // Try to catch the common pattern: - // - // typedef struct foo { ... } foo; - // - // here. - // - if inner_item.canonical_name(ctx) == name { - return; + { + let through_type_aliases = inner.into_resolver() + .through_type_refs() + .through_type_aliases() + .resolve(ctx); + + // Try to catch the common pattern: + // + // typedef struct foo { ... } foo; + // + // here, and also other more complex cases like #946. + if through_type_aliases.canonical_name(ctx) == name { + return; + } } // If this is a known named type, disallow generating anything @@ -1969,6 +1975,7 @@ impl MethodCodegen for Method { } }); + // TODO(emilio): We could generate final stuff at least. if self.is_virtual() { return; // FIXME } |