mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-15 19:39:33 +00:00
progress
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
import std / tables
|
||||
|
||||
import ast, astalgo, msgs, types, magicsys, semdata, renderer, options,
|
||||
lineinfos, modulegraphs, layeredtable
|
||||
lineinfos, modulegraphs, layeredtable, typeallowed
|
||||
|
||||
when defined(nimPreviewSlimSystem):
|
||||
import std/assertions
|
||||
@@ -296,9 +296,17 @@ proc replaceTypeVarsN(cl: var TReplTypeVars, n: PNode; start=0; expectedType: PT
|
||||
replaceTypeVarsS(cl, n.sym, replaceTypeVarsT(cl, n.sym.typ))
|
||||
if result.sym.kind == skField and
|
||||
(cl.owner == nil or result.sym.owner == cl.owner):
|
||||
if not cl.allowMetaTypes and result.typ != nil and result.typ.isMetaType:
|
||||
let invalidType =
|
||||
if not cl.allowMetaTypes and result.typ != nil and result.typ.isMetaType and
|
||||
result.sym.owner != nil and result.sym.owner.kind == skType:
|
||||
typeAllowed(result.typ, skVar, cl.c, {taProcContextIsNotMacro})
|
||||
else:
|
||||
nil
|
||||
# Constrained types can remain unresolved during overload matching. Only
|
||||
# reject the type-valued storage that can reach code generation (#24848).
|
||||
if invalidType != nil and invalidType.kind == tyTypeDesc:
|
||||
localError(cl.c.config, result.info,
|
||||
"'" & result.typ.typeToString & "' is not a concrete type")
|
||||
"'" & invalidType.typeToString & "' is not a concrete type")
|
||||
result.typ = errorType(cl.c)
|
||||
result.sym.typ = result.typ
|
||||
if result.sym.ast != nil:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
errormsg: "'array[0..0, typedesc[R[system.int]]]' is not a concrete type"
|
||||
errormsg: "'typedesc[R[system.int]]' is not a concrete type"
|
||||
line: 8
|
||||
"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user