using System; using System.Collections.Generic; class Program { public static void Main() { } private static IEnumerable FindIntersections( IBezier bezier, Ray ray, float epsilon, Range t1, int depth) where TVector : IVector { var bounds = bezier.GetBounds(); if (Intersect.s(ray, bounds)) { var intersections1 = new float[] { }; var intersections2 = new float[] { }; foreach (var t in intersections1) { yield return t; } foreach (var t in intersections2) { yield return t; } } } public static class Intersect { public static bool s(Ray ray, BoundingBoxN box) where TVector : IVector { throw new NotImplementedException(); } } public struct Range { } public class Ray where TVector : IVector { } public interface IBezier where TVector : IVector { BoundingBoxN GetBounds(); } public interface IVector : IEpsilonEquatable where T : IVector { } public interface IEpsilonEquatable // ReSharper enable TypeParameterCanBeVariant { } public struct BoundingBoxN where T : IVector { } }