public FTypeRef(string podName, string typeName, string sig)
{
this.podName = podName;
this.typeName = typeName;
// compute mask
int mask = 0;
int stackType = OBJ;
bool nullable = false;
if (sig.EndsWith("?")) { mask |= NULLABLE; nullable = true; }
if (sig.Length > 1) mask |= GENERIC_INSTANCE;
if (podName == "sys")
{
switch (typeName[0])
{
case 'B':
if (typeName == "Bool")
{
mask |= SYS_BOOL;
if (!nullable) stackType = INT;
}
break;
case 'E':
if (typeName == "Err") mask |= SYS_ERR;
break;
case 'F':
if (typeName == "Float")
{
mask |= SYS_FLOAT;
if (!nullable) stackType = DOUBLE;
}
break;
case 'I':
if (typeName == "Int")
{
mask |= SYS_INT;
if (!nullable) stackType = LONG;
}
break;
case 'O':
if (typeName == "Obj") mask |= SYS_OBJ;
break;
case 'V':
if (typeName == "Void") stackType = VOID;
break;
}
}
this.mask = mask;
this.stackType = stackType;
// compute full siguature
if (isGenericInstance())
this.signature = sig;
else
this.signature = podName + "::" + typeName + sig;
}