Dotborrow now works with generic distincts (#18848)
This commit is contained in:
parent
ef390e6a68
commit
172253cb55
4 changed files with 37 additions and 7 deletions
|
|
@ -1296,7 +1296,8 @@ 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:
|
||||
|
||||
if tfBorrowDot in s.typ.flags and s.typ.skipTypes({tyGenericBody}).kind != tyDistinct:
|
||||
excl s.typ.flags, tfBorrowDot
|
||||
localError(c.config, name.info, "only a 'distinct' type can borrow `.`")
|
||||
let aa = a[2]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue