Skip to content

Commit a716543

Browse files
metagnAraq
authored andcommitted
Clearer final objects error; fixes #13256 (#13257)
1 parent e7744b0 commit a716543

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/semtypes.nim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,8 @@ proc semObjectNode(c: PContext, n: PNode, prev: PType; isInheritable: bool): PTy
851851
else:
852852
if concreteBase.kind != tyError:
853853
localError(c.config, n[1].info, "inheritance only works with non-final objects; " &
854-
"to enable inheritance write '" & typeToString(realBase) & " of RootObj'")
854+
"for " & typeToString(realBase) & " to be inheritable it must be " &
855+
"'object of RootObj' instead of 'object'")
855856
base = nil
856857
realBase = nil
857858
if n.kind != nkObjectTy: internalError(c.config, n.info, "semObjectNode")

0 commit comments

Comments
 (0)