parent
3bba2b34fd
commit
13251c2ac9
2 changed files with 9 additions and 4 deletions
|
|
@ -826,7 +826,8 @@ proc getTypeDescAux(m: BModule, origTyp: PType, check: var IntSet; kind: TSymKin
|
||||||
m.s[cfsTypes].addf("typedef $1 $2[$3];$n",
|
m.s[cfsTypes].addf("typedef $1 $2[$3];$n",
|
||||||
[foo, result, rope(n)])
|
[foo, result, rope(n)])
|
||||||
of tyObject, tyTuple:
|
of tyObject, tyTuple:
|
||||||
if isImportedCppType(t) and origTyp.kind == tyGenericInst:
|
let tt = origTyp.skipTypes({tyDistinct})
|
||||||
|
if isImportedCppType(t) and tt.kind == tyGenericInst:
|
||||||
let cppNameAsRope = getTypeName(m, t, sig)
|
let cppNameAsRope = getTypeName(m, t, sig)
|
||||||
let cppName = $cppNameAsRope
|
let cppName = $cppNameAsRope
|
||||||
var i = 0
|
var i = 0
|
||||||
|
|
@ -849,7 +850,7 @@ proc getTypeDescAux(m: BModule, origTyp: PType, check: var IntSet; kind: TSymKin
|
||||||
result.add cppName.substr(chunkStart, chunkEnd)
|
result.add cppName.substr(chunkStart, chunkEnd)
|
||||||
chunkStart = i
|
chunkStart = i
|
||||||
|
|
||||||
let typeInSlot = resolveStarsInCppType(origTyp, idx + 1, stars)
|
let typeInSlot = resolveStarsInCppType(tt, idx + 1, stars)
|
||||||
addResultType(typeInSlot)
|
addResultType(typeInSlot)
|
||||||
else:
|
else:
|
||||||
inc i
|
inc i
|
||||||
|
|
@ -858,9 +859,9 @@ proc getTypeDescAux(m: BModule, origTyp: PType, check: var IntSet; kind: TSymKin
|
||||||
result.add cppName.substr(chunkStart)
|
result.add cppName.substr(chunkStart)
|
||||||
else:
|
else:
|
||||||
result = cppNameAsRope & "<"
|
result = cppNameAsRope & "<"
|
||||||
for i in 1..<origTyp.len-1:
|
for i in 1..<tt.len-1:
|
||||||
if i > 1: result.add(" COMMA ")
|
if i > 1: result.add(" COMMA ")
|
||||||
addResultType(origTyp[i])
|
addResultType(tt[i])
|
||||||
result.add("> ")
|
result.add("> ")
|
||||||
# always call for sideeffects:
|
# always call for sideeffects:
|
||||||
assert t.kind != tyTuple
|
assert t.kind != tyTuple
|
||||||
|
|
|
||||||
4
tests/cpp/t12946.nim
Normal file
4
tests/cpp/t12946.nim
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
import std/atomics
|
||||||
|
type Futex = distinct Atomic[int32]
|
||||||
|
|
||||||
|
var x: Futex
|
||||||
Loading…
Add table
Add a link
Reference in a new issue