regex() is not considered a constant expression by the compiler. This is inconsistent with its behavior regarding similar procs such as list() or matrix().
Numbered Steps to Reproduce Problem:
Try to compile the code below:
Code Snippet (if applicable) to Reproduce Problem:
/datum/foo
var/regex/bar = regex("bar")
Expected Results:
The code will compile.
Actual Results:
test.dm:2:error: =: expected a constant expression
Does the problem occur:
Every time? Or how often?
Every time.
In other games?
n/a
In other user accounts?
n/a
On other computers?
n/a
When does the problem NOT occur?
Happens every time.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
Occurs in earlier builds, AFAIK.
Workarounds:
/datum/foo
var/regex/bar = new /regex("bar")