FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
daScript/tests/dasSQLITE/failed_register_function.das at master · WhyNot135/daScript · GitHub
WhyNot135
/
daScript
Public
forked from
GaijinEntertainment/daScript
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
daScript
/
tests
/
dasSQLITE
/
failed_register_function.das
Copy path
More file actions
More file actions
Latest commit
History
History
History
50 lines (41 loc) · 1.08 KB
Breadcrumbs
daScript
/
tests
/
dasSQLITE
/
failed_register_function.das
Copy path
File metadata and controls
50 lines (41 loc) · 1.08 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
options
gen2
// register_function rejects unsupported argument and return types at compile
// time with a per-position diagnostic naming the offender.
//
// 1. struct argument
// 2. struct return
// 3. pointer argument
// 4. lambda passed instead of @@fn (not a function pointer)
// 5. > 4 arguments
expect
50503
:
5
require
daslib
/
sql
require
sqlite
/
sqlite_boost
require
daslib
/
sql_linq
struct
Foo
{
x : int
}
def
fn_struct_arg
(
f
:
Foo
) :
int
{
return
f
.
x
}
def
fn_struct_return
(
x
:
int
) :
Foo
{
return
Foo
(
x
=
x
)
}
def
fn_ptr_arg
(
p
:
void
?) :
int
{
return
p
==
null
?
0
:
1
}
def
fn_ok_two
(
a
:
int
;
b
:
int
) :
int
{
return
a
+
b
}
def
fn_five_args
(
a
:
int
;
b
:
int
;
c
:
int
;
d
:
int
;
e
:
int
) :
int
{
return
a
+
b
+
c
+
d
+
e
}
[
export
]
def
main
{
var
inscope
db
=
open_sqlite
(
":memory:"
)
db
|
>
register_function
(
"a"
, @@
fn_struct_arg
)
db
|
>
register_function
(
"b"
, @@
fn_struct_return
)
db
|
>
register_function
(
"c"
, @@
fn_ptr_arg
)
let
lam
=
@(
x
:
int
)
=>
x
+
1
db
|
>
register_function
(
"d"
,
lam
)
db
|
>
register_function
(
"e"
, @@
fn_five_args
)
}
Back
|
FazBrowse Home
|
New Git URL