Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bad codegen with cpp, works with c #30

Open
arkanoid87 opened this issue Mar 18, 2024 · 1 comment
Open

bad codegen with cpp, works with c #30

arkanoid87 opened this issue Mar 18, 2024 · 1 comment

Comments

@arkanoid87
Copy link

arkanoid87 commented Mar 18, 2024

import std/[enumerate]
import malebolgia

func threadFunc(a: int): int =
  a + a

proc run(inputs: openArray[int]): seq[int] =
  result = newSeq[int](inputs.len)
  var m = createMaster()
  m.awaitAll:
    for i, item in enumerate(inputs):
      m.spawn threadFunc(item) -> result[i]

echo run([1, 2, 3, 4, 5])
$ nim --skipUserCfg --skipParentCfg --skipProjCfg c -r thisfile.nim
@[2, 4, 6, 8, 10]
$ nim --skipUserCfg --skipParentCfg --skipProjCfg cpp -r thisfile.nim
/home/jack/.cache/nim/malebolgia_cpp_d/@mmalebolgia_cpp.nim.cpp: In function ‘tySequence__qwqHTkRvwhrRyENtudHQ7g run__malebolgia95cpp_u6(NI*, NI)’:
/home/jack/.cache/nim/malebolgia_cpp_d/@mmalebolgia_cpp.nim.cpp:334:240: error: use of deleted function ‘tyObject_Master__F3e20AfgTBHcMGUUxuJL1g& tyObject_Master__F3e20AfgTBHcMGUUxuJL1g::operator=(tyObject_Master__F3e20AfgTBHcMGUUxuJL1g&&)’
  334 | s/experiments/malebolgia_cpp.nim");        m = createMaster__OOZOOZOOZOnimbleZpkgs50Zmalebolgia4549O51O494551b54b56b48565757c5448515748dd5048525351c53f55a50a484953515450cf4851Zmalebolgia_u25(T3_);
  569 |         return result;
      |                ^~~~~~
/home/jack/.cache/nim/malebolgia_cpp_d/@m..@s..@[email protected]@spkgs2@smalebolgia-1.3.1-3b6b8b0899c60390dd20453c5f7a2a015362cf03@smalebolgia.nim.cpp:105:8: note: ‘tyObject_Master__F3e20AfgTBHcMGUUxuJL1g::tyObject_Master__F3e20AfgTBHcMGUUxuJL1g(const tyObject_Master__F3e20AfgTBHcMGUUxuJL1g&)’ is implicitly deleted because the default definition would be ill-formed:
  105 | struct tyObject_Master__F3e20AfgTBHcMGUUxuJL1g {

Version:

Nim Compiler Version 2.0.2 [Linux: amd64]
Compiled at 2023-12-15
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: c4c44d10df8a14204a75c34e499def200589cb7c
active boot switches: -d:release

package "[email protected]" with checksum "3b6b8b0899c60390dd20453c5f7a2a015362cf03"
@arkanoid87 arkanoid87 changed the title Compilation error: use of deleted function with cpp, works with c bad codegen with cpp, works with c Mar 18, 2024
@cvanelteren
Copy link

Running into the same issue, any movement on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants