public override Type GetType(ByteCodeGenerator manager) { var variable = manager.GetVariable(Identifier); var field = manager.Method.DeclaringType.Fields.FirstOrDefault(x => x.Name == Identifier); if (variable == null && field == null) { throw new InvalidOperationException(); } return variable == null ? field.ReturnType : variable.Type; }
private static LocalItem TryLocal(ByteCodeGenerator generator, PrimaryNode.TermIdentifierExpression id) { Variable localVariable = generator.GetVariable(id.Identifier); return localVariable != null ? new LocalItem(generator, localVariable) : null; }