-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Source Generator生成报错 #137
Comments
可以试试给MultiMap实现个indexer,这样就不会报错了 |
已修复,马上推送新release,不过这个做法需要实现索引器: public class MultiMap<T, K> : SortedDictionary<T, List<K>>
{
public new List<K> this[T key]
{
get
{
if (!TryGetValue(key, out List<K> value))
{
value = new List<K>();
Add(key, value);
}
return value;
}
set
{
if (value.Count == 0)
{
Remove(key);
}
else
{
base[key] = value;
}
}
}
} 等下会在文档内提一嘴 |
JasonXuDeveloper
added a commit
that referenced
this issue
Jan 13, 2025
- [fix] fixed source generator cannot detect the correct dictionary type parameters for a user defined dictionary subclass (#137)
JasonXuDeveloper
added a commit
that referenced
this issue
Jan 13, 2025
- [fix] fixed source generator cannot detect the correct dictionary type parameters for a user defined dictionary subclass (#137)
JasonXuDeveloper
added a commit
that referenced
this issue
Jan 13, 2025
- [fix] fixed source generator cannot detect the correct dictionary type parameters for a user defined dictionary subclass (#137)
JasonXuDeveloper
added a commit
that referenced
this issue
Jan 13, 2025
- [fix] fixed source generator cannot detect the correct dictionary type parameters for a user defined dictionary subclass (#137)
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Source Generator生成报错
报错类型
public class MultiMap<T, K>: SortedDictionary<T, List<K>>{}
报错定义
MultiMap<long, long> TimeId = new MultiMap<long, long>();
生成的代码
The text was updated successfully, but these errors were encountered: