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
I'd like to contribute to this project and this issue looks like a good fit. I'm still learning the codebase, so please bear with me.
I've been investigating the issue. For the expression user.Profile?.Address ?? "Unknown address", when Profile doesn't exist on the User struct, the type checker throws a "has no field" error during type checking.
Is this the issue we need to fix?
I also have a question about scope: should we also handle cases like:
user.Profiles[0]?.Address ?? "Unknown address"
I've made some changes to the checker, but I'm encountering an error from runtime.go file: "cannot fetch Profile from expr_test.User (1:6)". I'm still debugging this and would appreciate any guidance on the expected behavior.
Activity
ehabterra commentedon Dec 7, 2025
Hey @antonmedv,
I'd like to contribute to this project and this issue looks like a good fit. I'm still learning the codebase, so please bear with me.
I've been investigating the issue. For the expression
user.Profile?.Address ?? "Unknown address", when Profile doesn't exist on the User struct, the type checker throws a"has no field"error during type checking.Is this the issue we need to fix?
I also have a question about scope: should we also handle cases like:
I've made some changes to the checker, but I'm encountering an error from
runtime.gofile:"cannot fetch Profile from expr_test.User (1:6)". I'm still debugging this and would appreciate any guidance on the expected behavior.Thanks!
antonmedv commentedon Dec 8, 2025
Hey @ehabterra
Yes, i think this is the issue. Now sure what is the culprit here. Need to investigate.
fix: bug in optional chaining typechecker expr-lang#854
fix: bug in optional chaining typechecker expr-lang#854
fix: bug in optional chaining typechecker expr-lang#854
ehabterra commentedon Dec 8, 2025
This should be resolved now. Please let me know if I missed anything or if there's anything I should address. #874
antonmedv commentedon Dec 14, 2025
Actually, behavior here is correct. Playground is using types.Map and this is proper behavior.
Add test for handling missing property