mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-29 02:33:58 +00:00
makes DuplicateModuleImport back to an error (#25178)
fixes #24998 Basically it retraces back to the situation before https://github.com/nim-lang/Nim/pull/18366 and https://github.com/nim-lang/Nim/pull/18362, i.e. ```nim import fuzz/a import fuzz/a ``` ```nim import fuzz/a from buzz/a ``` ```nim import fuzz/a except nil from fuzz/a import addInt ``` All of these cases are now flagged as invalid and triggers a redefinition error, i.e., each module name importing is treated as consistent as the symbol definition kinda annoying for importing/exporting with `when conditions` though ref https://github.com/nim-lang/Nim/issues/18762 https://github.com/nim-lang/Nim/issues/20907 ```nim from std/strutils import toLower when not defined(js): from std/strutils import toUpper ```
This commit is contained in:
@@ -100,7 +100,7 @@ const
|
||||
stylePrefix = "\e["
|
||||
|
||||
when defined(windows):
|
||||
import std/[winlean, os]
|
||||
import std/os
|
||||
|
||||
const
|
||||
DUPLICATE_SAME_ACCESS = 2
|
||||
@@ -926,8 +926,6 @@ when defined(windows):
|
||||
stdout.write "\n"
|
||||
|
||||
else:
|
||||
import std/termios
|
||||
|
||||
proc readPasswordFromStdin*(prompt: string, password: var string):
|
||||
bool {.tags: [ReadIOEffect, WriteIOEffect].} =
|
||||
password.setLen(0)
|
||||
@@ -981,9 +979,6 @@ proc isTrueColorSupported*(): bool =
|
||||
## Returns true if a terminal supports true color.
|
||||
return getTerminal().trueColorIsSupported
|
||||
|
||||
when defined(windows):
|
||||
import std/os
|
||||
|
||||
proc enableTrueColors*() =
|
||||
## Enables true color.
|
||||
var term = getTerminal()
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
include osalloc
|
||||
import std/private/syslocks
|
||||
import std/sysatomics
|
||||
|
||||
template track(op, address, size) =
|
||||
when defined(memTracker):
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
#
|
||||
|
||||
# Compilerprocs for strings that do not depend on the string implementation.
|
||||
|
||||
import std/private/digitsutils
|
||||
|
||||
import std/private/digitsutils as digitsutils2
|
||||
|
||||
proc cmpStrings(a, b: string): int {.inline, compilerproc.} =
|
||||
let alen = a.len
|
||||
|
||||
Reference in New Issue
Block a user