mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-16 08:04:20 +00:00
some more bugfixes for the integer promotion rules
This commit is contained in:
@@ -906,7 +906,7 @@ proc semSubscript(c: PContext, n: PNode, flags: TExprFlags): PNode =
|
||||
n.sons[i] = semExprWithType(c, n.sons[i], flags)
|
||||
var indexType = if arr.kind == tyArray: arr.sons[0] else: getSysType(tyInt)
|
||||
var arg = IndexTypesMatch(c, indexType, n.sons[1].typ, n.sons[1])
|
||||
if arg != nil:
|
||||
if arg != nil:
|
||||
n.sons[1] = arg
|
||||
result = n
|
||||
result.typ = elemType(arr)
|
||||
|
||||
@@ -324,10 +324,11 @@ proc typeRel(mapping: var TIdTable, f, a: PType): TTypeRelation =
|
||||
of tyBool, tyChar:
|
||||
if a.kind == f.kind: result = isEqual
|
||||
elif skipTypes(a, {tyRange}).kind == f.kind: result = isSubtype
|
||||
of tyRange:
|
||||
if a.kind == f.kind:
|
||||
result = typeRel(mapping, base(a), base(f))
|
||||
if result < isGeneric: result = isNone
|
||||
of tyRange:
|
||||
if a.kind == f.kind:
|
||||
result = typeRel(mapping, base(f), base(a))
|
||||
# bugfix: accept integer conversions here
|
||||
#if result < isGeneric: result = isNone
|
||||
elif skipTypes(f, {tyRange}).kind == a.kind:
|
||||
result = isIntConv
|
||||
elif isConvertibleToRange(skipTypes(f, {tyRange}), a):
|
||||
|
||||
@@ -368,7 +368,7 @@ when defined(windows):
|
||||
lpWideCharStr = cstring(result),
|
||||
cchWideChar = cint(result.len div 2),
|
||||
lpMultiByteStr = cstring(res),
|
||||
cbMultiByte = cap)
|
||||
cbMultiByte = cap.cint)
|
||||
if m == 0:
|
||||
# try again; ask for capacity:
|
||||
cap = WideCharToMultiByte(
|
||||
@@ -386,7 +386,7 @@ when defined(windows):
|
||||
lpWideCharStr = cstring(result),
|
||||
cchWideChar = cint(result.len div 2),
|
||||
lpMultiByteStr = cstring(res),
|
||||
cbMultiByte = cap)
|
||||
cbMultiByte = cap.cint)
|
||||
if m == 0: OSError()
|
||||
setLen(res, m)
|
||||
result = res
|
||||
|
||||
@@ -10,7 +10,7 @@ import
|
||||
osproc,
|
||||
cairowin32, cairoxlib,
|
||||
gl, glut, glu, glx, glext, wingl,
|
||||
lua, lualib, lauxlib, mysql, sqlite3, db_mongo, osproc
|
||||
lua, lualib, lauxlib, mysql, sqlite3, db_mongo, md5
|
||||
|
||||
|
||||
writeln(stdout, "test compilation of binding modules")
|
||||
|
||||
Reference in New Issue
Block a user