Article

MyFSharpBot - syntax error in 1 line

Hi

Originally had 28 plus errors and now have wittled down to one.

Refer below.

As I have said before, I am typing away and trying to get a handle of the syntax.

Intellisense helps ..... but haven't got the experience to utilise it yet.

As always any help would be appreciated.

Thanks Sean

[<Sealed>]

type BfexplorerBotCreator() =
    interface IBotCreator with
        member this.Bots
            with get() = Bots.MyBots    <= here is underlined with squiggly line ERROR   
        member this.GetIsMyBot(botId : BotId) =
            // check valid range of your bots/ ids. Bfexplorer BotId starts from zero , use your unique range for your for bot identification
            botId.Id >= 100 && botId.Id <= 101
        member this.GetBotCreator(botId : BotId) =
            if (this :> IBotCreator).GetIsMyBot(botId)
            then
                Some Bots.MyBotsCreators.[botId.Id - 100]
            else
                None

Severity Code Description Project File Line Suppression State

Error FS0001 This expression was expected to have type
    'BotDescriptor list'   
but here has type
    'BotDescriptor []' MyFsharpBot C:\Users\sean\Documents\Visual Studio 2017\Projects\ConsoleApplication1\ConsoleApplication1\Bots.fs 29 Active

Comments ( 1 )


  • Admin
    2.9.2017 11:36:38

    Read the errorr message:

    Error FS0001 This expression was expected to have type
        'BotDescriptor list'   
    but here has type
        'BotDescriptor []' 

    so MyBots, and MyBotsCreators are list not arrays.

    You are using old bot sdk against the new bfexplorer backend assemblies.