diff --git a/src/AST/TypeExtensions.cs b/src/AST/TypeExtensions.cs index 7570dc45..9165713f 100644 --- a/src/AST/TypeExtensions.cs +++ b/src/AST/TypeExtensions.cs @@ -10,7 +10,7 @@ public static bool IsPrimitiveType(this Type t, out PrimitiveType primitive) { - var builtin = t as BuiltinType; + var builtin = t.Desugar() as BuiltinType; if (builtin != null) { primitive = builtin.Type; diff --git a/tests/Basic/Basic.h b/tests/Basic/Basic.h index 01860bf0..d247bf0f 100644 --- a/tests/Basic/Basic.h +++ b/tests/Basic/Basic.h @@ -303,9 +303,12 @@ struct EmptyNamedNestedEnum enum { Value = 10 }; }; - +typedef unsigned long foo_t; typedef struct SomeStruct { + const foo_t& operator[](int i) const { return p[i]; } + foo_t& operator[](int i) { return p[i]; } + foo_t* p; } SomeStruct;