[Wasm] Fix memory override in mono_wasm_add_assembly
[mono-project.git] / mcs / tests / gtest-iter-19.cs
blob3b4dc8099ac5df3eae428ccc1b1209435c05dc0d
1 using System;
2 using System.Linq;
3 using System.Collections;
4 using System.Collections.Generic;
6 public static class IEnumerableTransform
9 public static IEnumerable<TOut> Transform<TOut> (this IEnumerable<int> input, EmitterFunc<TOut> rule)
11 foreach (var v in input) {
12 TOut output;
13 rule (out output);
14 yield return output;
18 public static EmitterFunc<TOut> Emit<TOut> (TOut result)
20 return delegate (out TOut output) {
21 output = result;
25 public delegate void EmitterFunc<TOut> (out TOut output);
27 public static int Main ()
29 IEnumerable<int> arr = new int[3];
30 if (!arr.Transform<char> (IEnumerableTransform.Emit<char> ('t')).SequenceEqual(new char[] { 't', 't', 't'}))
31 return 1;
33 return 0;