Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CompileMember()

void System.Linq.Expressions.Interpreter.LightCompiler.CompileMember ( Expression from,
MemberInfo member,
bool forBinding )
inlineprivate

Definition at line 1850 of file LightCompiler.cs.

1851 {
1852 if (member is FieldInfo fieldInfo)
1853 {
1854 if (fieldInfo.IsLiteral)
1855 {
1856 _instructions.EmitLoad(fieldInfo.GetValue(null), fieldInfo.FieldType);
1857 }
1858 else if (fieldInfo.IsStatic)
1859 {
1860 if (forBinding)
1861 {
1862 throw Error.InvalidProgram();
1863 }
1864 if (fieldInfo.IsInitOnly)
1865 {
1866 _instructions.EmitLoad(fieldInfo.GetValue(null), fieldInfo.FieldType);
1867 }
1868 else
1869 {
1871 }
1872 }
1873 else
1874 {
1875 if (from != null)
1876 {
1878 }
1880 }
1881 return;
1882 }
1883 PropertyInfo propertyInfo = (PropertyInfo)member;
1884 if (propertyInfo != null)
1885 {
1887 if (forBinding && getMethod.IsStatic)
1888 {
1889 throw Error.InvalidProgram();
1890 }
1891 if (from != null)
1892 {
1894 }
1895 if (!getMethod.IsStatic && from != null && from.Type.IsNullableType())
1896 {
1898 }
1899 else
1900 {
1902 }
1903 }
1904 }
void EmitNullableCall(MethodInfo method, ParameterInfo[] parameters)

References System.Linq.Expressions.Interpreter.LightCompiler._instructions, System.Linq.Expressions.Interpreter.InstructionList.EmitCall(), System.Linq.Expressions.Interpreter.InstructionList.EmitLoad(), System.Linq.Expressions.Interpreter.InstructionList.EmitLoadField(), System.Linq.Expressions.Interpreter.InstructionList.EmitNullableCall(), System.Linq.Expressions.Interpreter.LightCompiler.EmitThisForMethodCall(), System.Reflection.PropertyInfo.GetGetMethod(), and System.Linq.Expressions.Error.InvalidProgram().

Referenced by System.Linq.Expressions.Interpreter.LightCompiler.CompileMemberExpression(), and System.Linq.Expressions.Interpreter.LightCompiler.CompileMemberInit().