doc\advopt.txt
added --reportConceptFailures switch
This commit is contained in:
parent
bf6211df6c
commit
e722770fbb
4 changed files with 11 additions and 4 deletions
|
|
@ -434,6 +434,8 @@ proc processSwitch(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) =
|
||||||
of "linedir": processOnOffSwitch({optLineDir}, arg, pass, info)
|
of "linedir": processOnOffSwitch({optLineDir}, arg, pass, info)
|
||||||
of "assertions", "a": processOnOffSwitch({optAssert}, arg, pass, info)
|
of "assertions", "a": processOnOffSwitch({optAssert}, arg, pass, info)
|
||||||
of "deadcodeelim": processOnOffSwitchG({optDeadCodeElim}, arg, pass, info)
|
of "deadcodeelim": processOnOffSwitchG({optDeadCodeElim}, arg, pass, info)
|
||||||
|
of "reportconceptfailures":
|
||||||
|
processOnOffSwitchG({optReportConceptFailures}, arg, pass, info)
|
||||||
of "threads":
|
of "threads":
|
||||||
processOnOffSwitchG({optThreads}, arg, pass, info)
|
processOnOffSwitchG({optThreads}, arg, pass, info)
|
||||||
#if optThreads in gGlobalOptions: incl(gNotes, warnGcUnsafe)
|
#if optThreads in gGlobalOptions: incl(gNotes, warnGcUnsafe)
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ type # please make sure we have under 32 options
|
||||||
TGlobalOption* = enum # **keep binary compatible**
|
TGlobalOption* = enum # **keep binary compatible**
|
||||||
gloptNone, optForceFullMake, optDeadCodeElim,
|
gloptNone, optForceFullMake, optDeadCodeElim,
|
||||||
optListCmd, optCompileOnly, optNoLinking,
|
optListCmd, optCompileOnly, optNoLinking,
|
||||||
optSafeCode, # only allow safe code
|
optReportConceptFailures, # report 'compiles' or 'concept' matching failures
|
||||||
optCDebug, # turn on debugging information
|
optCDebug, # turn on debugging information
|
||||||
optGenDynLib, # generate a dynamic library
|
optGenDynLib, # generate a dynamic library
|
||||||
optGenStaticLib, # generate a static library
|
optGenStaticLib, # generate a static library
|
||||||
|
|
|
||||||
|
|
@ -292,8 +292,6 @@ proc semConv(c: PContext, n: PNode): PNode =
|
||||||
|
|
||||||
proc semCast(c: PContext, n: PNode): PNode =
|
proc semCast(c: PContext, n: PNode): PNode =
|
||||||
## Semantically analyze a casting ("cast[type](param)")
|
## Semantically analyze a casting ("cast[type](param)")
|
||||||
if optSafeCode in gGlobalOptions: localError(n.info, errCastNotInSafeMode)
|
|
||||||
#incl(c.p.owner.flags, sfSideEffect)
|
|
||||||
checkSonsLen(n, 2)
|
checkSonsLen(n, 2)
|
||||||
result = newNodeI(nkCast, n.info)
|
result = newNodeI(nkCast, n.info)
|
||||||
result.typ = semTypeNode(c, n.sons[0], nil)
|
result.typ = semTypeNode(c, n.sons[0], nil)
|
||||||
|
|
@ -1659,11 +1657,13 @@ proc tryExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
|
||||||
let oldInGenericInst = c.inGenericInst
|
let oldInGenericInst = c.inGenericInst
|
||||||
let oldProcCon = c.p
|
let oldProcCon = c.p
|
||||||
c.generics = @[]
|
c.generics = @[]
|
||||||
|
var err: string
|
||||||
try:
|
try:
|
||||||
result = semExpr(c, n, flags)
|
result = semExpr(c, n, flags)
|
||||||
if msgs.gErrorCounter != oldErrorCount: result = nil
|
if msgs.gErrorCounter != oldErrorCount: result = nil
|
||||||
except ERecoverableError:
|
except ERecoverableError:
|
||||||
discard
|
if optReportConceptFailures in gGlobalOptions:
|
||||||
|
err = getCurrentExceptionMsg()
|
||||||
# undo symbol table changes (as far as it's possible):
|
# undo symbol table changes (as far as it's possible):
|
||||||
c.compilesContextId = oldCompilesId
|
c.compilesContextId = oldCompilesId
|
||||||
c.generics = oldGenerics
|
c.generics = oldGenerics
|
||||||
|
|
@ -1677,6 +1677,8 @@ proc tryExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
|
||||||
errorOutputs = oldErrorOutputs
|
errorOutputs = oldErrorOutputs
|
||||||
msgs.gErrorCounter = oldErrorCount
|
msgs.gErrorCounter = oldErrorCount
|
||||||
msgs.gErrorMax = oldErrorMax
|
msgs.gErrorMax = oldErrorMax
|
||||||
|
if optReportConceptFailures in gGlobalOptions and not err.isNil:
|
||||||
|
localError(n.info, err)
|
||||||
|
|
||||||
proc semCompiles(c: PContext, n: PNode, flags: TExprFlags): PNode =
|
proc semCompiles(c: PContext, n: PNode, flags: TExprFlags): PNode =
|
||||||
# we replace this node by a 'true' or 'false' node:
|
# we replace this node by a 'true' or 'false' node:
|
||||||
|
|
|
||||||
|
|
@ -151,6 +151,9 @@ can be found `here <https://nimworkshop.splashthat.com/>`_.
|
||||||
(issue `#2599 <https://github.com/nim-lang/Nim/issues/2599>`_).
|
(issue `#2599 <https://github.com/nim-lang/Nim/issues/2599>`_).
|
||||||
- The compiler now supports a `bitsize pragma <docs/manual.html#pragmas-bitsize-pragma>`_
|
- The compiler now supports a `bitsize pragma <docs/manual.html#pragmas-bitsize-pragma>`_
|
||||||
for constructing bitfields.
|
for constructing bitfields.
|
||||||
|
- Added a new ``--reportConceptFailures`` switch for better debugging of
|
||||||
|
concept related type mismatches. This can also be used to debug
|
||||||
|
``system.compiles`` failures.
|
||||||
|
|
||||||
|
|
||||||
Language Additions
|
Language Additions
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue