Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two classes, getting "type is not defined" error

Tags:

f#

I have two classes, Foo and Bar, two distinct files, foo.fs and bar.fs

namespace Ganymede.Versioning

type foo = class 
    val Bar : bar
    new(input) = { Bar = input }    
    end


namespace Ganymede.Versioning

type bar = class
    val Test : string
    new (input) = { Test = input; }
    end

I get a "The type 'bar' is not defined." error inside class foo, for val Bar : bar

Why is that?

like image 591
kitsune Avatar asked Jun 12 '09 20:06

kitsune


1 Answers

Files in a project must be ordered by dependency, so you need to put bar.fs above foo.fs in the project so that foo can see bar.

like image 104
GS - Apologise to Monica Avatar answered Oct 13 '22 21:10

GS - Apologise to Monica