Skip to content

Instantly share code, notes, and snippets.

@dteoh dteoh/unused-this.md
Last active Apr 17, 2019

Embed
What would you like to do?
Solving "unused variable this." warnings when using ReasonML objects

unused variable this

You can create objects in ReasonML. For example:

let document = {
  pub title = "My Treatise";
  pub contents = "<a lot of words>"
};

If you compile this, you will most likely get warning number 27 with message unused variable this..

You can solve this by adding as _; as follows:

let document = {
  as _;
  pub title = "My Treatise";
  pub contents = "<a lot of words>"
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.