fix a bug
This commit is contained in:
parent
c921a9f9cd
commit
8f01835cab
@ -35,7 +35,8 @@ shared_ptr<ValType> StructType::struct_replace(
|
|||||||
shared_ptr<StructType> ut,
|
shared_ptr<StructType> ut,
|
||||||
map<shared_ptr<TemplateType>, shared_ptr<TemplateType>>& eq) {
|
map<shared_ptr<TemplateType>, shared_ptr<TemplateType>>& eq) {
|
||||||
auto tt = make_shared<StructType>();
|
auto tt = make_shared<StructType>();
|
||||||
(*tt) = (*ut);
|
tt->str = str;
|
||||||
|
tt->mp = ut->mp;
|
||||||
set<shared_ptr<Struct>> vis;
|
set<shared_ptr<Struct>> vis;
|
||||||
for (auto u = str; u.get() != nullptr; u = u->fa.lock()) {
|
for (auto u = str; u.get() != nullptr; u = u->fa.lock()) {
|
||||||
vis.insert(u);
|
vis.insert(u);
|
||||||
|
32
tests/ok/simple-logic3.ac
Normal file
32
tests/ok/simple-logic3.ac
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
struct
|
||||||
|
{
|
||||||
|
struct A<x>()
|
||||||
|
{
|
||||||
|
struct AA<y>(){};
|
||||||
|
struct AB<y>()
|
||||||
|
{
|
||||||
|
struct ABA<z>()
|
||||||
|
{
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
struct B<x>()
|
||||||
|
{
|
||||||
|
struct BA<y>()
|
||||||
|
{
|
||||||
|
a = A<y>::AB<x>::ABA<y>();
|
||||||
|
};
|
||||||
|
struct BB<y>()
|
||||||
|
{
|
||||||
|
struct BBA<z>()
|
||||||
|
{
|
||||||
|
};
|
||||||
|
struct BBB<z>(p:z)
|
||||||
|
{
|
||||||
|
a = BA<z>();
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
struct C(delete){};
|
||||||
|
a = Fn<>()->A<C>::AB<B<C>>::ABA<C>{return B<B<C>>::BB<B<C>::BB<C>>::BBB<C>(admit<C>()).a.a;};
|
||||||
|
}main;
|
Loading…
x
Reference in New Issue
Block a user