I have a script like this, in a classes.psm1 file:
class A {
A([string] s) { }
}
class B : A {
B([string] s) : base($s)
}
Then I try to import it in a .ps file:
using module classes.psm1
class C : B {
[A] $p
C([string] s) : base($s) {
$this.p = A::new($s)
}
}
Above, B is known, but not A, throwing Unable to find type [A].
How is it possible to work with both classes in the latter script?
Note: Moving C in the same module as A and B makes it unknown in the latter script.