Generic type usage in a function being too restrictive

Summary

Type variable t used only in a result position. To avoid an ambiguous type for t, ensure it is also used in an argument position.

The above error message shows that the compiler is being too restrictive.

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Steps to Reproduce

# Put this type into one file
value_container(t: type) := struct {
  Value: t
}

# Pet this function into another file
GetValue(ValueContainer: value_container(t) where t: type)<transacts><decides>: t = {
  ValueContainer.Value
}

Expected Result

This should just work as the type is being used as part of a generic type.

Observed Result

The error messages prevents a proper API design as it forces the user to add an additional unused parameter for type information is already being transferred to the function via generic type information.

Platform(s)

UEFN (v36.20)

Can confirm that this happens, but it isn’t a restriction, but part of the “Can’t access a function from a preceding type.(3502)” issue.
It is just misleading because it shows additional errors on top of that one.

@Flak why was this moved to the feedback category? This is an issue in the language that prevents proper API design.