Skip to content

Commit

Permalink
Причёсываю PABCSystem.pas
Browse files Browse the repository at this point in the history
  • Loading branch information
miks1965 committed Feb 23, 2016
1 parent 94c0db5 commit 7908a03
Show file tree
Hide file tree
Showing 9 changed files with 934 additions and 366 deletions.
2 changes: 1 addition & 1 deletion Configuration/GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3";
public const string Minor = "1";
public const string Build = "0";
public const string Revision = "1173";
public const string Revision = "1174";

public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
Expand Down
4 changes: 2 additions & 2 deletions Configuration/Version.defs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%COREVERSION%=0
%REVISION%=1173
%MINOR%=1
%REVISION%=1174
%COREVERSION%=0
%MAJOR%=3
2 changes: 1 addition & 1 deletion ReleaseGenerators/PascalABCNET_version.nsh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
!define VERSION '3.1.0.1173'
!define VERSION '3.1.0.1174'
7 changes: 0 additions & 7 deletions TestSuite/foreachvar1.pas
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
{begin
var s := [1,2,3];
foreach var x in s do
begin
var y := x + x;
end;
end.}
type
TPair = auto class
Key: string;
Expand Down
13 changes: 13 additions & 0 deletions TestSuite/foreachvar3.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
procedure p<T>(s: set of T; f: T->T);
begin
foreach var x in s do
begin
var y := f(x);
Print(y);
end;
end;

begin
var s := [1,2,3,7,2,4];
p(s,x->x);
end.
8 changes: 4 additions & 4 deletions TreeConverter/TreeConversion/syntax_tree_visitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16287,12 +16287,11 @@ public bool FindIEnumerableElementType(SyntaxTree.foreach_stmt _foreach_stmt, ty
}
}

foreach (SemanticTree.ITypeNode itn in tn.ImplementingInterfaces)
foreach (SemanticTree.ITypeNode itn in tn.ImplementingInterfaces) // если не нашли - ищем интерфейс IEnumerable и возвращаем object в качестве elem_type
{
//if (itn == ctn)
if (itn is compiled_type_node)
{
var itnc = (itn as compiled_type_node).compiled_type;
/*var itnc = (itn as compiled_type_node).compiled_type;
if (itnc.IsGenericType)
{
var my = itnc.GetGenericTypeDefinition();// = typeof(System.Collections.Generic.IEnumerable<>)
Expand All @@ -16303,7 +16302,8 @@ public bool FindIEnumerableElementType(SyntaxTree.foreach_stmt _foreach_stmt, ty
return true;
}
}
else if (itn == ctn)
else */
if (itn == ctn)
{
elem_type = SystemLibrary.SystemLibrary.object_type;
return true;
Expand Down
Binary file modified bin/Lib/PABCRtl.dll
Binary file not shown.
Loading

0 comments on commit 7908a03

Please sign in to comment.