newruntime for async (#11650)

* fixes overloading resolution for passing owned(Future[string]) to Future[T]
* WIP: make --newruntime work with .async
* memtracker: make it compile again
* make Nimble compile again
This commit is contained in:
Andreas Rumpf 2019-07-05 01:42:17 +02:00 • committed by GitHub
commit 5f515410af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 60 additions and 47 deletions

View file

@ -1689,9 +1689,12 @@ template `isnot`*(x, y: untyped): untyped = not (x is y)
## assert 42 isnot float
## assert @[1, 2] isnot enum
when defined(nimV2) and not defined(nimscript):
when (defined(nimV2) and not defined(nimscript)) or defined(nimFixedOwned):
type owned*{.magic: "BuiltinType".}[T] ## type constructor to mark a ref/ptr or a closure as `owned`.
else:
template owned*(t: typeDesc): typedesc = t
when defined(nimV2) and not defined(nimscript):
proc new*[T](a: var owned(ref T)) {.magic: "New", noSideEffect.}
## Creates a new object of type ``T`` and returns a safe (traced)
## reference to it in ``a``.
@ -1716,7 +1719,6 @@ when defined(nimV2) and not defined(nimscript):
template `<//>`*(t: untyped): untyped = owned(t)
else:
template owned*(t: typeDesc): typedesc = t
template unown*(x: typed): untyped = x
proc new*[T](a: var ref T) {.magic: "New", noSideEffect.}