Skip to content

Commit

Permalink
PRTEMP warning instead of error for effects to see what passes
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Sep 9, 2021
1 parent fcb6617 commit 6ea6dd5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions compiler/sempass2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,10 @@ proc trackProc*(c: PContext; s: PSym, body: PNode) =
if sfThread in s.flags and t.gcUnsafe:
if optThreads in g.config.globalOptions and optThreadAnalysis in g.config.globalOptions:
#localError(s.info, "'$1' is not GC-safe" % s.name.s)
listGcUnsafety(s, onlyWarning=false, g.config)
if c.config.isLazySemcheck: # PRTEMP
listGcUnsafety(s, onlyWarning=true, g.config)
else:
listGcUnsafety(s, onlyWarning=false, g.config)
else:
listGcUnsafety(s, onlyWarning=true, g.config)
#localError(s.info, warnGcUnsafe2, s.name.s)
Expand All @@ -1473,7 +1476,10 @@ proc trackProc*(c: PContext; s: PSym, body: PNode) =
elif c.compilesContextId == 0: # don't render extended diagnostic messages in `system.compiles` context
var msg = ""
listSideEffects(msg, s, g.config, t.c)
message(g.config, s.info, errGenerated, msg)
if c.config.isLazySemcheck: # PRTEMP
message(g.config, s.info, warnProveInit, msg) # PRTEMP: wrong warning
else:
message(g.config, s.info, errGenerated, msg)
else:
localError(g.config, s.info, "") # simple error for `system.compiles` context
if not t.gcUnsafe:
Expand Down

0 comments on commit 6ea6dd5

Please sign in to comment.