Skip to content

Commit

Permalink
[unity] fix #1541
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieyang committed Sep 28, 2023
1 parent c8e9b21 commit ef45172
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions unity/Assets/core/upm/Editor/Src/Generator/DTS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,10 @@ static void AddRefType(HashSet<Type> workTypes, HashSet<Type> refTypes, Type typ
}
}

if (refTypes.Contains(rawType) || type.IsPointer || rawType.IsPointer) return;
if (!rawType.IsGenericParameter)
// if type == rawType, there is a chance that the type is already added to refTypes when it was a rawType.
// so, when refTypes contains rawType but type == rawType, most of the remain logic is still needed to run.
if ((refTypes.Contains(rawType) && type != rawType) || type.IsPointer || rawType.IsPointer) return;
if (!rawType.IsGenericParameter && !refTypes.Contains(rawType))
{
refTypes.Add(rawType);
}
Expand Down

0 comments on commit ef45172

Please sign in to comment.