When processing declarations in resolve-names.cpp, we were returning a
symbol that had SubprogramName details to PushSubprogramScope(), which
expects a symbol with Subprogram details.
I adjusted the code and added a test.
Differential Revision: https://reviews.llvm.org/D89829
details->set_specific(Resolve(name, *specific));
} else if (isGeneric()) {
SayAlreadyDeclared(name, *specific);
- } else if (!specific->has<SubprogramDetails>()) {
+ }
+ if (!specific->has<SubprogramDetails>()) {
specific->set_details(SubprogramDetails{});
}
return specific;
end subroutine
end interface
end module
+
+module m3
+ interface s
+ subroutine s
+ end
+ end interface
+contains
+ !ERROR: 's' is already declared in this scoping unit
+ subroutine s
+ end subroutine
+end