Move LSP semantics into typed analysis
This commit is contained in:
parent
f4cd4f4458
commit
bac1183593
26 changed files with 1232 additions and 637 deletions
15
examples/generics.gt
Normal file
15
examples/generics.gt
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
package main
|
||||
|
||||
data class Box<T>(var value: T) {
|
||||
fun get(): T { return value }
|
||||
}
|
||||
|
||||
fun identity<T>(value: T): T { return value }
|
||||
|
||||
fun main() {
|
||||
val number = identity(42)
|
||||
val text = identity<String>("value")
|
||||
val box = Box(text)
|
||||
println(number)
|
||||
println(box.get())
|
||||
}
|
||||
|
|
@ -30,7 +30,7 @@ class EpicControllerImpl(val db: *bun.DB) {
|
|||
db.NewCreateTable().Model(model).IfNotExists().Exec(ctx)
|
||||
val user = BunUser("user-from-gotlin")
|
||||
db.NewInsert().Model(user).Exec(ctx)
|
||||
val total = db.NewSelect().Model(model).Count(ctx)
|
||||
val total = db.NewSelect().Model(model).Count(ctx).unwrap()
|
||||
|
||||
fmt.Fprintln(w, "bun users total:", total)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue