Skip to content

Commit

Permalink
Clearer final objects error; fixes #13256 (#13257)
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn authored and Araq committed Jan 26, 2020
1 parent e7744b0 commit a716543
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/semtypes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,8 @@ proc semObjectNode(c: PContext, n: PNode, prev: PType; isInheritable: bool): PTy
else:
if concreteBase.kind != tyError:
localError(c.config, n[1].info, "inheritance only works with non-final objects; " &
"to enable inheritance write '" & typeToString(realBase) & " of RootObj'")
"for " & typeToString(realBase) & " to be inheritable it must be " &
"'object of RootObj' instead of 'object'")
base = nil
realBase = nil
if n.kind != nkObjectTy: internalError(c.config, n.info, "semObjectNode")
Expand Down

0 comments on commit a716543

Please sign in to comment.