diff src/testdir/test_vim9_class.vim @ 31744:1b2bde0c64f2 v9.0.1204

patch 9.0.1204: expression compiled the wrong way after using an object Commit: https://github.com/vim/vim/commit/912bfee71041fce0902bbcb649faf247519ec400 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 15 20:18:55 2023 +0000 patch 9.0.1204: expression compiled the wrong way after using an object Problem: Expression compiled the wrong way after using an object. Solution: Generate constants before getting the type.
author Bram Moolenaar <Bram@vim.org>
date Sun, 15 Jan 2023 21:30:03 +0100
parents 22a4824d7964
children d3d3ed2c09f6
line wrap: on
line diff
--- a/src/testdir/test_vim9_class.vim
+++ b/src/testdir/test_vim9_class.vim
@@ -240,6 +240,25 @@ def Test_list_of_objects()
   v9.CheckScriptSuccess(lines)
 enddef
 
+def Test_expr_after_using_object()
+  var lines =<< trim END
+      vim9script
+
+      class Something
+        this.label: string = ''
+      endclass
+
+      def Foo(): Something
+        var v = Something.new()
+        echo 'in Foo(): ' .. typename(v)
+        return v
+      enddef
+
+      Foo()
+  END
+  v9.CheckScriptSuccess(lines)
+enddef
+
 def Test_class_default_new()
   var lines =<< trim END
       vim9script