Creates a generic instance of the current generic method.
(...classes)
| 11856 | } |
| 11857 | /** Creates a generic instance of the current generic method. */ |
| 11858 | inflate(...classes) { |
| 11859 | if (!this.isGeneric) { |
| 11860 | (0, console_1.raise)(`cannot inflate method ${this.name}: it has no generic parameters`); |
| 11861 | } |
| 11862 | if (this.genericParameterCount != classes.length) { |
| 11863 | (0, console_1.raise)(`cannot inflate method ${this.name}: it needs ${this.genericParameterCount} generic parameter(s), not ${classes.length}`); |
| 11864 | } |
| 11865 | const types = classes.map(klass => klass.type.object); |
| 11866 | const typeArray = Il2Cpp.Array.from(Il2Cpp.Image.corlib.class("System.Type"), types); |
| 11867 | const inflatedMethodObject = this.object.method("MakeGenericMethod", 1).invoke(typeArray); |
| 11868 | return new Il2Cpp.Method(Il2Cpp.Api._methodGetFromReflection(inflatedMethodObject)); |
| 11869 | } |
| 11870 | /** Invokes this method. */ |
| 11871 | invoke(...parameters) { |
| 11872 | if (!this.isStatic) { |