summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/semexprs.nim2
-rw-r--r--tests/enum/tenumalias.nim7
2 files changed, 8 insertions, 1 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index 45d973d86..54a301322 100644
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -903,7 +903,7 @@ proc makeDeref(n: PNode): PNode =
 
 const
   tyTypeParamsHolders = {tyGenericInst, tyCompositeTypeClass}
-  tyDotOpTransparent = {tyVar, tyPtr, tyRef}
+  tyDotOpTransparent = {tyVar, tyPtr, tyRef, tyAlias}
 
 proc readTypeParameter(c: PContext, typ: PType,
                        paramName: PIdent, info: TLineInfo): PNode =
diff --git a/tests/enum/tenumalias.nim b/tests/enum/tenumalias.nim
new file mode 100644
index 000000000..2d1f70d0e
--- /dev/null
+++ b/tests/enum/tenumalias.nim
@@ -0,0 +1,7 @@
+# bug #5148
+
+type
+  A = enum foo, bar
+  B = A
+
+echo B.foo