From 8b79ca3d2b40c23aaf3a97cc6f2d12dcaa5fa1ab Mon Sep 17 00:00:00 2001 From: Alex Povar Date: Mon, 1 Aug 2016 15:47:39 +0300 Subject: [PATCH] Add reference to _this_ and _base_ keywords in ctor initializer --- ICSharpCode.Decompiler/Ast/TextTokenWriter.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ICSharpCode.Decompiler/Ast/TextTokenWriter.cs b/ICSharpCode.Decompiler/Ast/TextTokenWriter.cs index 2cfff7d96..d7e8fcfb9 100644 --- a/ICSharpCode.Decompiler/Ast/TextTokenWriter.cs +++ b/ICSharpCode.Decompiler/Ast/TextTokenWriter.cs @@ -188,6 +188,15 @@ namespace ICSharpCode.Decompiler.Ast public override void WriteKeyword(Role role, string keyword) { + //To make reference for 'this' and 'base' keywords in the ClassName():this() expression + if (role == ConstructorInitializer.ThisKeywordRole || role == ConstructorInitializer.BaseKeywordRole) { + var reference = GetCurrentMemberReference(); + if (reference != null) { + output.WriteReference(keyword, reference); + return; + } + } + output.Write(keyword); }