diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2019-03-06 14:22:12 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-03-06 14:22:12 +0100 |
commit | 3c0f01faa0125f8632951290ad1475e1d93b3b1a (patch) | |
tree | d903533d7a05c24d8505c043c4725415dceeac7b | |
parent | 32c9ca605e407bdcb288c66a3ed23625bf2474be (diff) | |
download | Nim-3c0f01faa0125f8632951290ad1475e1d93b3b1a.tar.gz |
fixes #10791
-rw-r--r-- | compiler/semstmts.nim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 163a85895..859856e48 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -1189,6 +1189,9 @@ proc typeSectionRightSidePass(c: PContext, n: PNode) = incl a[2].flags, nfSem # bug #10548 if sfExportc in s.flags and s.typ.kind == tyAlias: localError(c.config, name.info, "{.exportc.} not allowed for type aliases") + if tfBorrowDot in s.typ.flags and s.typ.kind != tyDistinct: + excl s.typ.flags, tfBorrowDot + localError(c.config, name.info, "only a 'distinct' type can borrow `.`") let aa = a.sons[2] if aa.kind in {nkRefTy, nkPtrTy} and aa.len == 1 and aa.sons[0].kind == nkObjectTy: |