}
if (data instanceof Environment)
{
Environment declarations = (Environment)data;
HaxeType currClass = (HaxeType)declarations.get("this");
declaration = currClass.getDeclaration(node.getText());
}
else if (data instanceof HaxeType)
{
declaration = ((HaxeType) data).getDeclaration(node.getChild(0).getText());
}
if ( declaration == null || !(declaration instanceof Function))
{
return;
}
List<Declaration> declParams =
((Function)declaration).getParametersAsDeclarations();
// TODO: whtat about optional params?
if (declParams.size() != params.size())
{
return;
}
for (int i = 0; i < params.size(); i++)
{
HaxeType ctype = params.get(i).getHaxeType(true);
HaxeType dType = declParams.get(i).getHaxeType(true);
if (ctype != null && !ctype.equals(dType))
{
return;
}
}