unoplatform / Uno.CodeGen

A set of source generators for equality, immutability, ...

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

B.Builder() from class B returns a class A object when B inherit from A

YGuerin opened this issue · comments

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)

Current behavior

B.Builder() from class B returns a class A object when B inherit from A

Expected behavior

B.Builder() from class B returns a class B object when B inherit from A

Minimal reproduction of the problem with instructions

Class A

[GeneratedImmutable]
public partial class ClassA
{
	[... some properties ...]
}

Class B

[GeneratedImmutable]
public partial class ClassB : ClassA
{
	[... some properties ...]
}

And call this wherever you want

var test = new ClassB.Builder()
	.WithPropertyFromClassA(...)
	.WithPropertyFromClassB(....)
	.ToImmutable();

Doesn't work because ClassB.Builder() is returning a ClassA object

Environment

Nuget Package: 5.7.0

Package Version(s): Uno.UI 3.0.11 / Uno.CodeGen 1.32.0

Affected platform(s):
- [ X ] iOS
- [ X ] Android
- [ X ] WebAssembly
- [ X ] Windows
- [ ] Build tasks

Visual Studio
- [ X ] 2019 (version: 16.7.2 )
- [ ] 2017 (version: )
- [ ] 2017 Preview (version: )
- [ ] for Mac (version: )

Relevant plugins
- [ ] Resharper (version: )