diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2021-12-04 07:42:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-04 07:42:34 +0100 |
commit | 23c117a950a3ce0e3c85d4f89409075329648230 (patch) | |
tree | faeb52e4c659f3c559193f92b716d20c450aea4b /compiler/semobjconstr.nim | |
parent | 373c909300c9ecef159666ac196e360fbd7a3ebc (diff) | |
download | Nim-23c117a950a3ce0e3c85d4f89409075329648230.tar.gz |
misc bugfixes [backport:1.2] (#19203)
Diffstat (limited to 'compiler/semobjconstr.nim')
-rw-r--r-- | compiler/semobjconstr.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/semobjconstr.nim b/compiler/semobjconstr.nim index 30ab76957..6d11d321e 100644 --- a/compiler/semobjconstr.nim +++ b/compiler/semobjconstr.nim @@ -366,9 +366,9 @@ proc defaultConstructionError(c: PContext, t: PType, info: TLineInfo) = if objType.kind == tyObject: var constrCtx = initConstrContext(objType, newNodeI(nkObjConstr, info)) let initResult = semConstructTypeAux(c, constrCtx, {}) - assert constrCtx.missingFields.len > 0 - localError(c.config, info, - "The $1 type doesn't have a default value. The following fields must be initialized: $2." % [typeToString(t), listSymbolNames(constrCtx.missingFields)]) + if constrCtx.missingFields.len > 0: + localError(c.config, info, + "The $1 type doesn't have a default value. The following fields must be initialized: $2." % [typeToString(t), listSymbolNames(constrCtx.missingFields)]) elif objType.kind == tyDistinct: localError(c.config, info, "The $1 distinct type doesn't have a default value." % typeToString(t)) |