diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ast.nim | 7 | ||||
-rw-r--r-- | compiler/commands.nim | 6 |
2 files changed, 9 insertions, 4 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim index b82002b06..62c301a43 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -592,8 +592,11 @@ const tfReturnsNew* = tfInheritable skError* = skUnknown - # type flags that are essential for type equality: - eqTypeFlags* = {tfIterator, tfNotNil, tfVarIsPtr} +var + eqTypeFlags* = {tfIterator, tfNotNil, tfVarIsPtr, tfGcSafe, tfNoSideEffect} + ## type flags that are essential for type equality. + ## This is now a variable because for emulation of version:1.0 we + ## might exclude {tfGcSafe, tfNoSideEffect}. type TMagic* = enum # symbols that require compiler magic: diff --git a/compiler/commands.nim b/compiler/commands.nim index 935d7e2be..0c93654da 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -32,6 +32,7 @@ import pathutils, strtabs from incremental import nimIncremental +from ast import eqTypeFlags, tfGcSafe, tfNoSideEffect # but some have deps to imported modules. Yay. bootSwitch(usedTinyC, hasTinyCBackend, "-d:tinyc") @@ -869,10 +870,11 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo; of "1.0": defineSymbol(conf.symbols, "NimMajor", "1") defineSymbol(conf.symbols, "NimMinor", "0") - # always be compatible with 1.0.2 for now: - defineSymbol(conf.symbols, "NimPatch", "2") + # always be compatible with 1.0.100: + defineSymbol(conf.symbols, "NimPatch", "100") # old behaviors go here: defineSymbol(conf.symbols, "nimOldRelativePathBehavior") + ast.eqTypeFlags.excl {tfGcSafe, tfNoSideEffect} else: localError(conf, info, "unknown Nim version; currently supported values are: {1.0}") of "benchmarkvm": |