-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
Following code doesn't work:
# Module A
proc foo(a: string): string =
return a
template baz*(a: string): string =
var b = a.foo()
b# Module B
import A
echo baz("hello")
# xxx template/generic instantiation from here
# xxx Error: attempting to call undeclared routine: 'foo'Works replacing the method call by a regular proc call. Also works as is when using the template within module A. Also works when exporting foo. I can only guess the compiler tries to resolve the method call too late. The method call limitations section of the manual does not mention this specific case.