Jona4Play
Jona4Play
CC#
Created by Jona4Play on 10/14/2023 in #help
✅ Issues with interfaces and generic classes
Thanks to everyone @here. Thanks to your input I was able to figure it out 👍
64 replies
CC#
Created by Jona4Play on 10/14/2023 in #help
✅ Issues with interfaces and generic classes
I have implemented a simpler working version, although I'd like to pick up the Generic version tomorrow
64 replies
CC#
Created by Jona4Play on 10/14/2023 in #help
✅ Issues with interfaces and generic classes
No description
64 replies
CC#
Created by Jona4Play on 10/14/2023 in #help
✅ Issues with interfaces and generic classes
just drag in a whole project and it auto generates it
64 replies
CC#
Created by Jona4Play on 10/14/2023 in #help
✅ Issues with interfaces and generic classes
Visual Studio Class Designer. Its installable through the VS installer
64 replies
CC#
Created by Jona4Play on 10/14/2023 in #help
✅ Issues with interfaces and generic classes
Yeah this would work. But I think I'll try the approach you described first
64 replies
CC#
Created by Jona4Play on 10/14/2023 in #help
✅ Issues with interfaces and generic classes
Ok thanks
64 replies
CC#
Created by Jona4Play on 10/14/2023 in #help
✅ Issues with interfaces and generic classes
I... dont think I fully understand what you mean by that. Could you please elaborate or give me an example?
64 replies
CC#
Created by Jona4Play on 10/14/2023 in #help
✅ Issues with interfaces and generic classes
let a = Mol.Of(new Compound("", ""), 1)
let b : Mol<ISolute> = Mol.Of(new Compound("", ""), 1)
let a = Mol.Of(new Compound("", ""), 1)
let b : Mol<ISolute> = Mol.Of(new Compound("", ""), 1)
This has the same error
64 replies
CC#
Created by Jona4Play on 10/14/2023 in #help
✅ Issues with interfaces and generic classes
Ok. I believe I messed up, as it shows the same thing but with it now being broader the error changed
public class Mol<T> where T:IAmount
public class Mol<T> where T:IAmount
Is the header for the Mol class But its now Mol<IAmount> is not compatible with Mol<ISolute> Which means its still doesnt recognize the inheritance of the interface
64 replies
CC#
Created by Jona4Play on 10/14/2023 in #help
✅ Issues with interfaces and generic classes
Yeah arrows are fucked up. It the VS designer thing
64 replies
CC#
Created by Jona4Play on 10/14/2023 in #help
✅ Issues with interfaces and generic classes
ok give me a minute
64 replies
CC#
Created by Jona4Play on 10/14/2023 in #help
✅ Issues with interfaces and generic classes
Thing is though, that this isnt possible. It should be the IAmount interface as mol of elements are possible. So should I change it to IAmount? Wouldn't this have the same issue with interface inheritance as beforehand?
64 replies
CC#
Created by Jona4Play on 10/14/2023 in #help
✅ Issues with interfaces and generic classes
Well shit. How would you correct for that?
64 replies
CC#
Created by Jona4Play on 10/14/2023 in #help
✅ Issues with interfaces and generic classes
But ISolute inherits IAmount
64 replies
CC#
Created by Jona4Play on 10/14/2023 in #help
✅ Issues with interfaces and generic classes
Ok sure. That makes sense 👍
64 replies
CC#
Created by Jona4Play on 10/14/2023 in #help
✅ Issues with interfaces and generic classes
Maybe there is a way around this
64 replies
CC#
Created by Jona4Play on 10/14/2023 in #help
✅ Issues with interfaces and generic classes
No. Same error
64 replies
CC#
Created by Jona4Play on 10/14/2023 in #help
✅ Issues with interfaces and generic classes
Just says Mol<Compound> is not compatible with Mol<ISolute> eventhough Compound implements both IAmount and ISolute
64 replies
CC#
Created by Jona4Play on 10/14/2023 in #help
✅ Issues with interfaces and generic classes
Nope. Sadly not. I honestly dont quite understand the error. It says that there is a type mismatch. I suspect it being the use of the Mol<IAmount> Wrapper class causing this
64 replies