Fixed MethodScanner that on latest prm value fails

Unit test for this case added anyway
[#5125] Trim default vale at assignment time