Ejemplo n.º 1
0
        public Type EndUnionTypeDefinition(Symbol typeSymbol, UnionGenerationHelper helper)
        {
            Type resultType = helper.FinalizeType();

            // book-keeping
            m_typesInCreation.Remove(typeSymbol);
            AddCompleteTypeDefinition(typeSymbol, new CompileTimeTypeContainer(this, resultType));

            return(resultType);
        }
Ejemplo n.º 2
0
        public UnionGenerationHelper StartUnionTypeDefinition(Symbol typeSymbol, string fullyQualName)
        {
            if (IsTypeDeclarded(typeSymbol))
            {
                // was not skipped, tried to redeclare -> internal error
                throw new InternalCompilerException("A type with the name " +
                                                    GetKnownType(typeSymbol).GetCompactClsType().FullName +
                                                    " is already declared for symbol: " + typeSymbol);
            }

            UnionGenerationHelper genHelper = new UnionGenerationHelper(m_modBuilder, fullyQualName,
                                                                        TypeAttributes.Public);

            AddRepositoryIdAttribute(genHelper.Builder, typeSymbol);
            // book-keeping
            TypeContainer container = new CompileTimeTypeContainer(this, genHelper.Builder);

            m_typesInCreation[typeSymbol] = container;

            return(genHelper);
        }