diff options
-rw-r--r-- | Extras/CSharpBinding/ChangeLog | 6 | ||||
-rw-r--r-- | Extras/CSharpBinding/Parser/Resolver.cs | 31 |
2 files changed, 21 insertions, 16 deletions
diff --git a/Extras/CSharpBinding/ChangeLog b/Extras/CSharpBinding/ChangeLog index 88a3ce4824..67d4717260 100644 --- a/Extras/CSharpBinding/ChangeLog +++ b/Extras/CSharpBinding/ChangeLog @@ -1,3 +1,9 @@ +2007-11-01 Lluis Sanchez Gual <lluis@novell.com> + + * Parser/Resolver.cs: Restore IsAsResolve logic. Is/as are used for + downcasting, so it only makes sense to return subclasses of the provided + type. + 2007-10-29 Michael Hutchinson <mhutchinson@novell.com> * Gui/CSharpTextEditorExtension.cs: Don't try to look back past first diff --git a/Extras/CSharpBinding/Parser/Resolver.cs b/Extras/CSharpBinding/Parser/Resolver.cs index e02f63f274..271fa7e609 100644 --- a/Extras/CSharpBinding/Parser/Resolver.cs +++ b/Extras/CSharpBinding/Parser/Resolver.cs @@ -1227,22 +1227,21 @@ namespace CSharpBinding.Parser if (currentUnit != null) { callingClass = GetInnermostClass (); } - IReturnType type = new ReturnType ("System.Object"); -// IReturnType type = expr.AcceptVisitor (typeVisitor, null) as IReturnType; -// if (type == null || type.PointerNestingLevel != 0) { -// fcu = parserContext.ParseFile (fileName, fileContent).MostRecentCompilationUnit.Tag as ICSharpCode.NRefactory.Ast.CompilationUnit; -// lookupTableVisitor.VisitCompilationUnit (fcu, null); -// currentUnit = (ICompilationUnit)csharpVisitor.VisitCompilationUnit (fcu, null); -// -// if (currentUnit != null) { -// callingClass = GetInnermostClass (); -// } -// type = expr.AcceptVisitor (typeVisitor, null) as IReturnType; -// if (type == null) -// return null; -// } -// if (type.ArrayDimensions != null && type.ArrayDimensions.Length > 0) -// type = new ReturnType ("System.Array"); + IReturnType type = expr.AcceptVisitor (typeVisitor, null) as IReturnType; + if (type == null || type.PointerNestingLevel != 0) { + fcu = parserContext.ParseFile (fileName, fileContent).MostRecentCompilationUnit.Tag as ICSharpCode.NRefactory.Ast.CompilationUnit; + lookupTableVisitor.VisitCompilationUnit (fcu, null); + currentUnit = (ICompilationUnit)csharpVisitor.VisitCompilationUnit (fcu, null); + + if (currentUnit != null) { + callingClass = GetInnermostClass (); + } + type = expr.AcceptVisitor (typeVisitor, null) as IReturnType; + if (type == null) + return null; + } + if (type.ArrayDimensions != null && type.ArrayDimensions.Length > 0) + type = new ReturnType ("System.Array"); IClass returnClass = SearchType (type, currentUnit); // IClass returnClass = parserContext.SearchType (type.FullyQualifiedName, null, currentUnit); |