You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe we can add logic to stop adding a pointer to interfaces. That could be super hard. I don't know 😢 but I can come back to this later if no one else does; I don't have the time at this moment.
The text was updated successfully, but these errors were encountered:
What I expected:
Given a class that extends an abstract class, like Person:
pkl-go/codegen/snippet-tests/input/Classes.pkl
Line 49 in 4541166
pkl-go/codegen/snippet-tests/output/bugholder/Person.pkl.go
Line 4 in 4541166
When you reference a Person in another class as nullable, like with Bug:
pkl-go/codegen/snippet-tests/input/Classes.pkl
Lines 81 to 83 in 4541166
pkl-go/codegen/snippet-tests/output/bugholder/Bug.pkl.go
Line 12 in 4541166
Then, we should generate a reference to the Person interface because interfaces themselves are pointers and
nil
by default.What I have observed:
Then, we generate a reference to a pointer of Person:
pkl-go/codegen/snippet-tests/output/bugholder/Bug.pkl.go
Lines 10 to 12 in 4541166
What is the problem?
When we use a
Bug
and access theOwner
, we have to dereference the value to access the data and create named constructors to use our structs:https://github.com/flyinprogrammer/pkl-go-bananas/blob/7210f20ca30593f9d0ebad3665bcec1ebed6a128/main.go#L9-L28
This is very awkward.
Maybe we can add logic to stop adding a pointer to interfaces. That could be super hard. I don't know 😢 but I can come back to this later if no one else does; I don't have the time at this moment.
The text was updated successfully, but these errors were encountered: