mirror of
https://github.com/Kindelia/Kind2.git
synced 2024-09-11 07:15:45 +03:00
Lit.Core: prevent users from defining type named "U64"
This commit is contained in:
parent
a88817c5c9
commit
13a2e5e6ba
@ -447,7 +447,11 @@ Lit.Core.World.run.statement(
|
||||
data:
|
||||
log("- new_type: " | type.name)
|
||||
case world{type.name} as got_type {
|
||||
none: some(world{type.name} <- Lit.Core.Entry.type(type))
|
||||
none:
|
||||
if not(type.name =? "U64") then
|
||||
some(world{type.name} <- Lit.Core.Entry.type(type))
|
||||
else
|
||||
log("error: cannot redefine built-in type named 'U64'") none
|
||||
} default log("error: type redefinition: " | type.name) none
|
||||
}
|
||||
bond:
|
||||
@ -623,7 +627,13 @@ Lit.Core.World.run.terms(
|
||||
// -----
|
||||
Lit.Core: _
|
||||
let world = {}
|
||||
let code = Lit.Lang.Type|Lit.Lang.Cmp|Lit.Lang.Nat|Lit.Lang.Bits|Lit.Lang.BitsMap|`
|
||||
let code =
|
||||
Lit.Lang.Type
|
||||
| Lit.Lang.Cmp
|
||||
| Lit.Lang.Nat
|
||||
| Lit.Lang.Bits
|
||||
| Lit.Lang.BitsMap
|
||||
|`
|
||||
type BoolList {
|
||||
nil
|
||||
cons{
|
||||
|
@ -156,7 +156,7 @@ BitsMap.transct_2(state: BitsMap, from: Bits, to: Bits, sum: Bits): BitsMap
|
||||
//[[dando um set]]
|
||||
|
||||
//alterar o valor do receiver (adicionar o sum )
|
||||
[[dando um set ]]
|
||||
// [[dando um set ]]
|
||||
// call
|
||||
// state
|
||||
// false:
|
||||
|
@ -67,4 +67,6 @@ type BitsBitsBits {
|
||||
snd: Bits
|
||||
trd: Bits
|
||||
}
|
||||
}
|
||||
|
||||
`
|
||||
|
Loading…
Reference in New Issue
Block a user