summary refs log tree commit diff stats
path: root/compiler/semexprs.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/semexprs.nim')
-rw-r--r--compiler/semexprs.nim6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index d6659f76b..58f3f9316 100644
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -2264,6 +2264,12 @@ proc semMagic(c: PContext, n: PNode, s: PSym, flags: TExprFlags): PNode =
   of mSizeOf:
     markUsed(c, n.info, s)
     result = semSizeof(c, setMs(n, s))
+  of mDefault:
+    result = semDirectOp(c, n, flags)
+    c.config.internalAssert result[1].typ.kind == tyTypeDesc
+    let typ = result[1].typ.base
+    if typ.kind in {tyObject, tyTuple}:
+      checkDefaultConstruction(c, typ, n.info)
   else:
     result = semDirectOp(c, n, flags)