Skip to content

feat: allow field access on concrete types behind interface values#952

Merged
antonmedv merged 6 commits into
expr-lang:masterfrom
snaffi:feature/get-embedded-interface-properties
Jun 4, 2026
Merged

feat: allow field access on concrete types behind interface values#952
antonmedv merged 6 commits into
expr-lang:masterfrom
snaffi:feature/get-embedded-interface-properties

Conversation

@snaffi
Copy link
Copy Markdown
Contributor

@snaffi snaffi commented Mar 31, 2026

Issue
#951

Comment thread vm/runtime/runtime.go Outdated
fk := f.Type.Kind()

// Dereference pointers to get to the underlying type.
for fk == reflect.Ptr {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets use our deref package.

Comment thread vm/runtime/runtime.go
snaffi added 2 commits May 19, 2026 09:19
…dedInterfaces

Replace hand-rolled pointer/interface unwrap loops with deref.Value and
deref.Type, consistent with how Fetch already dereferences values.

Add white-box unit tests covering each branch (100% coverage of the
function): plain struct, embedded interface with/without field, pointer
to struct concrete value, nil concrete value, nil embedded pointer,
nested embedded struct, nested embedded interface, non-struct concrete
value, expr:"-" tag, and empty concrete struct.
@snaffi
Copy link
Copy Markdown
Contributor Author

snaffi commented May 19, 2026

@antonmedv hello, I appologize for late response. Yours comments have been addressed.

Comment thread vm/runtime/runtime_test.go
@antonmedv
Copy link
Copy Markdown
Member

Looks like something with tests.

@snaffi
Copy link
Copy Markdown
Contributor Author

snaffi commented Jun 4, 2026

@antonmedv hello

Looks like GA jobs are stuck, could you please assist a little bit?

@antonmedv antonmedv merged commit 2010a11 into expr-lang:master Jun 4, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants