Code review comment: Yes, initializers are not added to attached function.

Code under review:
private void defineFunction(DataInputStream dataInStream) throws IOException {
        skipPosition(dataInStream); 
        
        String funcName = getStringCPEntryValue(dataInStream);
        String workerName = getStringCPEntryValue(dataInStream);
        int flags = dataInStream.readInt();

        BInvokableType funcType = (BInvokableType) readBType(dataInStream);
        BInvokableSymbol invokableSymbol = Symbols.createFunctionSymbol(flags, names.fromString(funcName),
                this.env.pkgSymbol.pkgID, funcType, this.env.pkgSymbol, Symbols.isFlagOn(flags, Flags.NATIVE));
        invokableSymbol.retType = funcType.retType;

        Scope scopeToDefine = this.env.pkgSymbol.scope;

        if (this.currentStructure != null) {
            BType attachedType = this.currentStructure.type;

            
            invokableSymbol.owner = attachedType.tsymbol;
            invokableSymbol.name =
                    names.fromString(Symbols.getAttachedFuncSymbolName(attachedType.tsymbol.name.value, funcName));
            if (attachedType.tag == TypeTags.OBJECT || attachedType.tag == TypeTags.RECORD) {
                if (attachedType.tag == TypeTags.OBJECT) {
                    scopeToDefine = ((BObjectTypeSymbol) attachedType.tsymbol).methodScope;
                } else {
                    scopeToDefine = attachedType.tsymbol.scope;
                }
                BAttachedFunction attachedFunc =
                        new BAttachedFunction(names.fromString(funcName), invokableSymbol, funcType);
                BStructureTypeSymbol structureTypeSymbol = (BStructureTypeSymbol) attachedType.tsymbol;
                if (Names.USER_DEFINED_INIT_SUFFIX.value.equals(funcName)
                        || funcName.equals(Names.INIT_FUNCTION_SUFFIX.value)) {
                    structureTypeSymbol.initializerFunc = attachedFunc;
                } else if (funcName.equals(Names.GENERATED_INIT_SUFFIX.value)) {
                    ((BObjectTypeSymbol) structureTypeSymbol).generatedInitializerFunc = attachedFunc;
                } else {
                    structureTypeSymbol.attachedFuncs.add(attachedFunc);
                }
            }
        }

        
        
        dataInStream.skip(dataInStream.readLong());

        
        setParamSymbols(invokableSymbol, dataInStream);

        
        readTaintTable(invokableSymbol, dataInStream);

        defineMarkDownDocAttachment(invokableSymbol, readDocBytes(dataInStream));

        dataInStream.skip(dataInStream.readLong()); 

        scopeToDefine.define(invokableSymbol.name, invokableSymbol);
    }

Line commented on: structureTypeSymbol.attachedFuncs.add(attachedFunc);

Revised code:
private void defineFunction(DataInputStream dataInStream) throws IOException {
        skipPosition(dataInStream); 
        
        String funcName = getStringCPEntryValue(dataInStream);
        String workerName = getStringCPEntryValue(dataInStream);
        int flags = dataInStream.readInt();

        BInvokableType funcType = (BInvokableType) readBType(dataInStream);
        BInvokableSymbol invokableSymbol = Symbols.createFunctionSymbol(flags, names.fromString(funcName),
                this.env.pkgSymbol.pkgID, funcType, this.env.pkgSymbol, Symbols.isFlagOn(flags, Flags.NATIVE));
        invokableSymbol.retType = funcType.retType;

        Scope scopeToDefine = this.env.pkgSymbol.scope;

        if (this.currentStructure != null) {
            BType attachedType = this.currentStructure.type;

            
            invokableSymbol.owner = attachedType.tsymbol;
            invokableSymbol.name =
                    names.fromString(Symbols.getAttachedFuncSymbolName(attachedType.tsymbol.name.value, funcName));
            if (attachedType.tag == TypeTags.OBJECT || attachedType.tag == TypeTags.RECORD) {
                if (attachedType.tag == TypeTags.OBJECT) {
                    scopeToDefine = ((BObjectTypeSymbol) attachedType.tsymbol).methodScope;
                } else {
                    scopeToDefine = attachedType.tsymbol.scope;
                }
                BAttachedFunction attachedFunc =
                        new BAttachedFunction(names.fromString(funcName), invokableSymbol, funcType);
                BStructureTypeSymbol structureTypeSymbol = (BStructureTypeSymbol) attachedType.tsymbol;
                if (Names.USER_DEFINED_INIT_SUFFIX.value.equals(funcName)
                        || funcName.equals(Names.INIT_FUNCTION_SUFFIX.value)) {
                    structureTypeSymbol.initializerFunc = attachedFunc;
                } else if (funcName.equals(Names.GENERATED_INIT_SUFFIX.value)) {
                    ((BObjectTypeSymbol) structureTypeSymbol).generatedInitializerFunc = attachedFunc;
                } else {
                    structureTypeSymbol.attachedFuncs.add(attachedFunc);
                }
            }
        }

        
        
        dataInStream.skip(dataInStream.readLong());

        
        setParamSymbols(invokableSymbol, dataInStream);

        
        readTaintTable(invokableSymbol, dataInStream);

        defineMarkDownDocAttachment(invokableSymbol, readDocBytes(dataInStream));

        dataInStream.skip(dataInStream.readLong()); 

        scopeToDefine.define(invokableSymbol.name, invokableSymbol);
    }