Stream: beginners

Topic: disambiguating static dispatch methods from struct fields


view this post on Zulip Victor Menge (Dec 23 2025 at 15:35):

hey!
been following roc for years, and really impressed with some of the changes done here.

recently with the new compiler, my understanding is that when we use . after a variable on the body of a function following with what seems like a method call like so:

foo = |x| {
  x.bar("aaa")
}

that the compiler will infer this to be a method implemented for that type.

if x was a struct, that had a closure called bar inside it, how would i write this function instead?

view this post on Zulip Richard Feldman (Dec 23 2025 at 16:22):

you just need some parens! (x.bar)("aaa")


Last updated: Jan 12 2026 at 12:19 UTC