In lib/std/math/vector.c3:111, double[<*>].pow is defined as:
macro double[<*>] double[<*>].pow(double[<*>] x, exp) => pow(x, exp);
When inlined into a caller outside std::math, pow lacks a module prefix and causes a compile error.
Reproduction
module app;
import std;
fn void test()
{
Vec3 v = { 1.0, 2.0, 3.0 };
Vec3 asd = v.pow(2.0);
}
Compiler Output
$ c3c compile asd.c3
73: macro float[<*>] float[<*>].fma(float[<*>] a, float[<*>] b, float[<*>] c) => $$fma(a, b, c);
74: macro float[<*>] float[<*>].floor(float[<*>] x) => $$floor(x);
75: macro float[<*>] float[<*>].nearbyint(float[<*>] x) => $$nearbyint(x);
76: macro float[<*>] float[<*>].pow(float[<*>] x, exp) => pow(x, exp);
^^^
/home/mb/scripts/c3c/lib/std/math/vector.c3:76:55: error: Macros from other modules must be prefixed with the module name, please use math::pow instead.
4: fn void test()
5: {
6: Vec3 v = { 1.0, 2.0, 3.0 };
7: Vec3 asd = v.pow(2.0);
^^^^^^^^^^
/home/mb/scripts/c3c/asd.c3:7:16: note: Inlined from here.
To fix I've just prefixed pow with math:: in lib/std/math/vector.c3:
macro double[<*>] double[<*>].pow(double[<*>] x, exp) => math::pow(x, exp);
In
lib/std/math/vector.c3:111,double[<*>].powis defined as:When inlined into a caller outside
std::math,powlacks a module prefix and causes a compile error.Reproduction
Compiler Output
To fix I've just prefixed
powwithmath::inlib/std/math/vector.c3: