File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
ICSharpCode.Decompiler/IL/Transforms Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -142,9 +142,20 @@ private void DetermineCaptureAndDeclarationScopes(Dictionary<MethodDefinitionHan
142142 {
143143 DetermineCaptureAndDeclarationScope ( info , useSite ) ;
144144
145- if ( context . Function . Method . IsConstructor && localFunction . DeclarationScope == null )
145+ if ( context . Function . Method . IsConstructor )
146146 {
147- localFunction . DeclarationScope = BlockContainer . FindClosestContainer ( useSite ) ;
147+ if ( localFunction . DeclarationScope == null )
148+ {
149+ localFunction . DeclarationScope = BlockContainer . FindClosestContainer ( useSite ) ;
150+ }
151+ else
152+ {
153+ localFunction . DeclarationScope = FindCommonAncestorInstruction < BlockContainer > ( useSite , localFunction . DeclarationScope ) ;
154+ if ( localFunction . DeclarationScope == null )
155+ {
156+ localFunction . DeclarationScope = ( BlockContainer ) context . Function . Body ;
157+ }
158+ }
148159 }
149160 }
150161
You can’t perform that action at this time.
0 commit comments