empirical-soft / empirical-lang

A language for time-series analysis
https://www.empirical-soft.com/
Other
168 stars 13 forks source link

User-defined function has empty traits #45

Closed chrisaycock closed 4 years ago

chrisaycock commented 4 years ago
>>> func inc(x: Int64): return x + 1 end

>>> traits_of(inc)
none

We expect

pure, transform, linear

The most likely culprit is that the argument x has empty traits from Sema's declaration visitor. (That's because there is no expression for x to initialize against.) The remedy is to have Sema's FunctionDef visitor set the parameter to all traits.