[nim-dev] Re: Understanding dynamic binding behavior in static blocks

  • From: "gneu" <dmarc-noreply-outsider@xxxxxxxxxxxxx> (Redacted sender "gerd.neudert" for DMARC)
  • To: nim-dev@xxxxxxxxxxxxx
  • Date: Wed, 2 Nov 2016 14:04:24 +0000

Just as info for other Nim-novices like me:
It is even possible to call a method at compile time, using procCall and 
explicitly casting to the desired type. In my given example, it could be done 
like so:
```nim
echo "compiletime procCall      : " & $(procCall 
MyType(x).intSumDynamic(MyType(y)))
```
This is awesome, because it solves the original problem I was puzzling with 
while I encountered the behavior described in my initial post.

Other related posts: