fsprojects / FSharp.Compiler.PortaCode

The PortaCode F# code format and corresponding interpreter. Used by Fabulous and others.
Other
42 stars 11 forks source link

Model with types in an external lib seem to be null in the environment #15

Closed 7sharp9 closed 5 years ago

7sharp9 commented 5 years ago

I have a model like this:

    type Model =
        {   Player : Sprite option
            Elapsed : TimeSpan
            Game: Game option
            SpriteBatch: SpriteBatch option 
            }

I seem to get to a point in interpreting where the model in null in the env, this is where the view contains access to dotted external types (model.Game) :

    let view (model: Model) (dispatch: Msg -> unit) =
        printfn "updating view 5"
        match model.Game with
        | Some game -> game.GraphicsDevice.Clear Color.Blue
        | _ -> ()

Screenshot 2019-05-24 at 17 45 55

Any pointers?

7sharp9 commented 5 years ago

Heh, I fixed this, initialisation logic in hot reload was a race condition :-)