-
I am writing .d,tl files for an existing project (not mine). That project has a module which returns its version as a string when required, like this: require "foo.version" -- returns "v1.2.3" Is there any way to type this in Teal? I tried this:
but then if I do this:
I get:
|
Beta Was this translation helpful? Give feedback.
Answered by
icy-lava
Feb 27, 2023
Replies: 1 comment 2 replies
-
Late reply but - you're returning a type when you should be returning a value. So instead you can do something like I don't know if there's a more standard way of doing this. Could also do: local version: string
return version |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
hishamhm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Late reply but - you're returning a type when you should be returning a value. So instead you can do something like
return "anything"
orreturn nil as string
.I don't know if there's a more standard way of doing this.
Could also do: