예제 #1
0
파일: Scope.cs 프로젝트: taekun/lens
        /// <summary>
        /// Creates a closure type in the closest appropriate scope.
        /// </summary>
        private TypeEntity createClosureType(Context ctx, Scope scope = null)
        {
            var cscope = findScope(s => s.Kind != ScopeKind.Unclosured, scope ?? this);

            if (cscope.ClosureType == null)
            {
                cscope.ClosureType      = ctx.CreateType(ctx.Unique.ClosureName());
                cscope.ClosureType.Kind = TypeEntityKind.Closure;
            }
            return(cscope.ClosureType);
        }
예제 #2
0
파일: Scope.cs 프로젝트: TrickyCat/lens
 /// <summary>
 /// Creates a closure type for current closure.
 /// </summary>
 public void CreateClosureType(Context ctx)
 {
     var id = ctx.GetClosureId();
     var closureName = string.Format(EntityNames.ClosureTypeNameTemplate, id);
     ClosureTypeId = id;
     ClosureType = ctx.CreateType(closureName, isSealed: true, prepare: true);
     ClosureType.Kind = TypeEntityKind.Closure;
 }