TP0211
Error: function references a top-level variable
Messages
Section titled “Messages”'<f>' cannot use top-level variable '<x>', with helppass it as a parameter, or make it a const
Example
Section titled “Example”From the golden case tests/cases/m14/tp0211_defaults.tpn:
let limit = 10
def f(n: int = limit) -> int: return n
print(f())The compiler reports:
tp0211_defaults.tpn:3:16: error TP0211: 'f' cannot use top-level variable 'limit' help: pass it as a parameter, or make it a constThe specification lists every code.
© 2026 Discover Edge, LLC · Taipan is released under the MIT License.