From 4a6d699bc5651e834622ea8653d6a1a03ac75bd2 Mon Sep 17 00:00:00 2001 From: Araq Date: Fri, 21 Dec 2018 17:16:14 +0100 Subject: [PATCH] C++: make async tests green on Windows --- compiler/sigmatch.nim | 10 +++++----- lib/windows/winlean.nim | 2 +- tests/async/tasynctry.nim | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index d66e8d121f..0915f303b3 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -2231,14 +2231,14 @@ proc matchesAux(c: PContext, n, nOrig: PNode, else: m.state = csNoMatch return - + if formal.typ.kind == tyVar: - let arg_converter = if arg.kind == nkHiddenDeref: arg[0] else: arg - if arg_converter.kind == nkHiddenCallConv: - if arg_converter.typ.kind != tyVar: + let argConverter = if arg.kind == nkHiddenDeref: arg[0] else: arg + if argConverter.kind == nkHiddenCallConv: + if argConverter.typ.kind != tyVar: m.state = csNoMatch m.mutabilityProblem = uint8(f-1) - return + return elif not n.isLValue: m.state = csNoMatch m.mutabilityProblem = uint8(f-1) diff --git a/lib/windows/winlean.nim b/lib/windows/winlean.nim index 3e37b824cf..1be9827670 100644 --- a/lib/windows/winlean.nim +++ b/lib/windows/winlean.nim @@ -516,7 +516,7 @@ type fd_count*: cint # unsigned fd_array*: array[0..FD_SETSIZE-1, SocketHandle] - Timeval* = object + Timeval* {.importc: "timeval", header: "".} = object tv_sec*, tv_usec*: int32 AddrInfo* = object diff --git a/tests/async/tasynctry.nim b/tests/async/tasynctry.nim index b13c57951d..a7cb5223d6 100644 --- a/tests/async/tasynctry.nim +++ b/tests/async/tasynctry.nim @@ -6,6 +6,7 @@ Multiple idents in except Multiple except branches Multiple except branches 2 ''' +targets: "c" """ import asyncdispatch, strutils