mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-29 04:24:43 +00:00
Merge branch 'main' into beta
This commit is contained in:
commit
a9d4e5982b
8 changed files with 107 additions and 19 deletions
|
@ -1330,13 +1330,13 @@ impl Context {
|
|||
proc.register_superclass(Obj, &obj);
|
||||
// TODO: lambda
|
||||
proc.register_marker_trait(mono("Named"));
|
||||
let mut func = Self::mono_class("Function", Self::TOP_LEVEL);
|
||||
func.register_superclass(mono("Procedure"), &proc);
|
||||
let mut func = Self::mono_class("Func", Self::TOP_LEVEL);
|
||||
func.register_superclass(mono("Proc"), &proc);
|
||||
func.register_superclass(Obj, &obj);
|
||||
// TODO: lambda
|
||||
func.register_marker_trait(mono("Named"));
|
||||
let mut qfunc = Self::mono_class("QuantifiedFunction", Self::TOP_LEVEL);
|
||||
qfunc.register_superclass(mono("Function"), &func);
|
||||
let mut qfunc = Self::mono_class("QuantifiedFunc", Self::TOP_LEVEL);
|
||||
qfunc.register_superclass(mono("Func"), &func);
|
||||
qfunc.register_superclass(Obj, &obj);
|
||||
self.register_builtin_type(Obj, obj, Const);
|
||||
// self.register_type(mono("Record"), vec![], record, Const);
|
||||
|
@ -1423,9 +1423,9 @@ impl Context {
|
|||
self.register_builtin_type(array_mut_t, array_mut_, Const);
|
||||
self.register_builtin_type(range_t, range, Const);
|
||||
self.register_builtin_type(mono("Tuple"), tuple_, Const);
|
||||
self.register_builtin_type(mono("Procedure"), proc, Const);
|
||||
self.register_builtin_type(mono("Function"), func, Const);
|
||||
self.register_builtin_type(mono("QuantifiedFunction"), qfunc, Const);
|
||||
self.register_builtin_type(mono("Proc"), proc, Const);
|
||||
self.register_builtin_type(mono("Func"), func, Const);
|
||||
self.register_builtin_type(mono("QuantifiedFunc"), qfunc, Const);
|
||||
}
|
||||
|
||||
fn init_builtin_funcs(&mut self) {
|
||||
|
|
|
@ -1089,13 +1089,13 @@ impl Context {
|
|||
}
|
||||
}
|
||||
Type::Quantified(_) => {
|
||||
if let Some(res) = self.get_nominal_type_ctx(&mono("QuantifiedFunction")) {
|
||||
if let Some(res) = self.get_nominal_type_ctx(&mono("QuantifiedFunc")) {
|
||||
return Some(res);
|
||||
}
|
||||
}
|
||||
Type::Subr(_subr) => match _subr.kind {
|
||||
SubrKind::Func => {
|
||||
if let Some(res) = self.get_nominal_type_ctx(&mono("Function")) {
|
||||
if let Some(res) = self.get_nominal_type_ctx(&mono("Func")) {
|
||||
return Some(res);
|
||||
}
|
||||
}
|
||||
|
@ -1157,7 +1157,7 @@ impl Context {
|
|||
}
|
||||
}
|
||||
Type::Quantified(_) => {
|
||||
if let Some(res) = self.get_mut_nominal_type_ctx(&mono("QuantifiedFunction")) {
|
||||
if let Some(res) = self.get_mut_nominal_type_ctx(&mono("QuantifiedFunc")) {
|
||||
return Some(res);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue