/
smwwiki
/
OneScript_fork
Обзор
Документация
Войти
/
smwwiki
/
OneScript_fork
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/OneScript.Core/Contexts/MemberInfoExtensions.cs
29 строк
958 B
EvilBeaver
Удалил MethodSignature из контекста компиляции
21 авг 2021, 18:54
21 авг 2021, 18:54
3917310
Код
Авторство
О чём код?
/*---------------------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. ----------------------------------------------------------*/ using System.Reflection; using System.Runtime.CompilerServices; namespace OneScript.Contexts { public static class MemberInfoExtensions { public static bool IsByRef(this ParameterInfo parameter) { if (parameter is BslParameterInfo bslParam) return !bslParam.ExplicitByVal; return parameter.ParameterType.IsByRef || parameter.IsDefined(typeof(ByRefAttribute)); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsFunction(this MethodInfo method) { return method.ReturnType != typeof(void); } } }