patch 8.2.0818: Vim9: using a discovery phase doesn't work well

Problem:    Vim9: using a discovery phase doesn't work well.
Solution:   Remove the discovery phase, instead compile a function only when
            it is used.  Add :defcompile to compile def functions earlier.
diff --git a/src/testdir/vim9.vim b/src/testdir/vim9.vim
index 0c16576..fdad9f7 100644
--- a/src/testdir/vim9.vim
+++ b/src/testdir/vim9.vim
@@ -2,7 +2,7 @@
 
 " Check that "lines" inside ":def" results in an "error" message.
 func CheckDefFailure(lines, error)
-  call writefile(['def Func()'] + a:lines + ['enddef'], 'Xdef')
+  call writefile(['def Func()'] + a:lines + ['enddef', 'defcompile'], 'Xdef')
   call assert_fails('so Xdef', a:error, a:lines)
   call delete('Xdef')
 endfunc