We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9542d00 commit 0f1ff15Copy full SHA for 0f1ff15
tests/structs/implicit-cast.bas
@@ -0,0 +1,32 @@
1
+#include "fbcunit.bi"
2
+
3
+SUITE( fbc_tests.structs.implicit_cast )
4
5
+ TEST_GROUP( cast_string )
6
7
+ function p overload( byref z as const wstring ) as string
8
+ return "wstring"
9
+ end function
10
11
+ function p( byref s as const string ) as string
12
+ return "string"
13
14
15
+ type T
16
+ __ as integer
17
+ declare operator cast() as string
18
+ end type
19
+ operator T.cast() as string
20
+ return "123"
21
+ end operator
22
23
+ TEST( default )
24
+ dim x as T
25
+ CU_ASSERT( left( x, 1 ) = "1" )
26
+ CU_ASSERT( right( x, 1 ) = "3" )
27
+ CU_ASSERT( p( x ) = "string" )
28
+ END_TEST
29
30
+ END_TEST_GROUP
31
32
+END_SUITE
0 commit comments