landelare/ue5coro

Live coding breaks generators

qwe321 opened this issue · 2 comments

While some simple generators work for most of the time when rebuilding using live coding, there are cases in which generators are broken, i.e.

template <typename TItem>
class TWrappedMap
{
public:
	TMap<FString, TItem> Map;

	TGenerator<TPair<FString, TItem>> SomeGenerator()
	{
		for (const auto& Item : Map)
			co_yield TPair<FString, TItem>(Item);
	}

	TGenerator<TPair<FString, TItem>> OtherGenerator() { ... }
}

Rebuilding the code with live coding will result in crash where stacktrace looks like wrong method is getting called (i.e. SomeGenerator gets swapped with OtherGenerator, for SomeGenerator call stacktrace shows OtherGenerator$_ResumeCoro$1(...), crash further points to constructor of TConstSetBitIterator breaking at range check.

You might be seeing the effects of this bug: MolecularMatters/lpp_public#3

Since this doesn't appear to be a bug with UE5Coro, I'm inclined to close this. If you think that there's something related in TGenerator that I can fix, please reopen this issue with additional information.