This script throws an exception:
key TheAnyKey;
default
{
state_entry() {
TheAnyKey = NULL_KEY;
llOwnerSay("Hello world!");
}
}
System.InvalidProgramException: Invalid IL code in LSL_2d835e04_fee6_b208_4a1e_e1549c71e776:defaultstate_entry (): IL_004a: stfld 0x04000001
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[])
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000]
This does not occur when assigning the value in a declare, or when assigning the value of a function or another variable. That is, this will run with no problem:
default
{
state_entry() {
key TheAnyKey = NULL_KEY;
key TheOtherKey = "34ffd167-9c28-4fb0-8f19-8b86294abf95";
TheAnyKey = llGetOwner();
TheAnyKey = TheOtherKey;
llOwnerSay("Hello world!");
}
}