fix #2071
This commit is contained in:
parent
cefb2564ab
commit
a7047fe990
|
|
@ -2773,6 +2773,7 @@ namespace PascalABCCompiler
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private Dictionary<string, SyntaxTree.syntax_namespace_node> IncludeNamespaces(CompilationUnit Unit)
|
||||
{
|
||||
|
|
@ -2811,7 +2812,7 @@ namespace PascalABCCompiler
|
|||
|
||||
}
|
||||
}
|
||||
Dictionary<string, SyntaxTree.syntax_namespace_node> namespaces = new Dictionary<string, SyntaxTree.syntax_namespace_node>();
|
||||
Dictionary<string, SyntaxTree.syntax_namespace_node> namespaces = new Dictionary<string, SyntaxTree.syntax_namespace_node>(StringComparer.OrdinalIgnoreCase);
|
||||
List<SyntaxTree.unit_or_namespace> namespace_modules = new List<SyntaxTree.unit_or_namespace>();
|
||||
foreach (string file in files)
|
||||
{
|
||||
|
|
@ -3304,7 +3305,7 @@ namespace PascalABCCompiler
|
|||
|
||||
for (int i = SyntaxUsesList.Count - 1 - CurrentUnit.InterfaceUsedUnits.Count; i >= 0; i--)
|
||||
{
|
||||
if (IsPossibleNamespace(SyntaxUsesList[i], true))
|
||||
if (IsPossibleNamespace(SyntaxUsesList[i], true) || namespaces.ContainsKey(SyntaxUsesList[i].name.idents[0].name))
|
||||
{
|
||||
CurrentUnit.InterfaceUsedUnits.AddElement(new TreeRealization.namespace_unit_node(GetNamespace(SyntaxUsesList[i])));
|
||||
CurrentUnit.PossibleNamespaces.Add(SyntaxUsesList[i]);
|
||||
|
|
|
|||
6
TestSuite/namespaces/Spacename.pas
Normal file
6
TestSuite/namespaces/Spacename.pas
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
namespace Spacename;
|
||||
|
||||
type TClass = class
|
||||
end;
|
||||
|
||||
end.
|
||||
7
TestSuite/use_ns_spacename.pas
Normal file
7
TestSuite/use_ns_spacename.pas
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
//nopabcrtl
|
||||
{$includenamespace 'namespaces/Spacename.pas'}
|
||||
uses Spacename;
|
||||
|
||||
begin
|
||||
var t: TClass;
|
||||
end.
|
||||
Loading…
Reference in a new issue