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
We can use or import modules in function scope. Trying to do that in a class or record scope, I am getting a syntax error. I think we should be able to do that but that's not a strong preference for me, at all. However, emitting a syntax error for attempting to do so feels wrong and we should provide a more helpful error message.
record R {
use IO;
}
You can swap record with class, and use with import. The behavior is the same.
The text was updated successfully, but these errors were encountered:
This seems useful to me as well, as a way of making an external module's symbols available to all the primary methods on a record/class, or to use its symbols to define the fields. At least, I can't think of a reason we wouldn't / shouldn't support it.
We can
use
orimport
modules in function scope. Trying to do that in a class or record scope, I am getting a syntax error. I think we should be able to do that but that's not a strong preference for me, at all. However, emitting a syntax error for attempting to do so feels wrong and we should provide a more helpful error message.You can swap
record
withclass
, anduse
withimport
. The behavior is the same.The text was updated successfully, but these errors were encountered: