Local variable default values reset in function library

This doesn’t happen to float or any other type that isn’t an ObjectReference type (eg material, skeletal mesh, etc). To repro this in a new project:

  1. Create a material
  2. Create a function library
  3. Add a function to the library
  4. Add a local variable to the function in the library
  5. Change the type of the local variable to a material
  6. Select the material you created in step 1 as the variable’s default value
  7. Compile

Some screenshots from before and after I compiled the function: