nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
metamodel: MMLocalClass::[] aborts if no global class
[nit.git]
/
src
/
metamodel
/
inheritance.nit
diff --git
a/src/metamodel/inheritance.nit
b/src/metamodel/inheritance.nit
index
dd6a9ba
..
9988426
100644
(file)
--- a/
src/metamodel/inheritance.nit
+++ b/
src/metamodel/inheritance.nit
@@
-193,11
+193,13
@@
redef class MMLocalClass
redef meth [](glob)
do
redef meth [](glob)
do
- var prop = super(glob)
- if prop == null and _global_properties.has(glob) then
- prop = inherit_local_property(glob)
+ if _local_property_by_global.has_key(glob) then
+ return _local_property_by_global[glob]
+ else if has_global_property(glob) then
+ return inherit_local_property(glob)
+ else
+ abort
end
end
- return prop
end
# Add default super class in direct parent and in super classes if this is not the Object class
end
# Add default super class in direct parent and in super classes if this is not the Object class
@@
-338,8
+340,7
@@
redef class MMLocalClass
# First compute the set of bottom properties
var impls = new ArraySet[MMLocalProperty]
for sc in supers do
# First compute the set of bottom properties
var impls = new ArraySet[MMLocalProperty]
for sc in supers do
- var p = sc[glob]
- if p != null then impls.add(p)
+ if sc.has_global_property(glob) then impls.add(sc[glob])
end
# Second, extract most specific
var impls2 = ghier.select_smallests(impls)
end
# Second, extract most specific
var impls2 = ghier.select_smallests(impls)
@@
-377,9
+378,8
@@
redef class MMLocalProperty
set_global(g)
var impls = new Array[MMLocalProperty]
for sc in local_class.che.direct_greaters do
set_global(g)
var impls = new Array[MMLocalProperty]
for sc in local_class.che.direct_greaters do
- var p = sc[g]
- if p == null then continue
- impls.add(p)
+ if not sc.has_global_property(g) then continue
+ impls.add(sc[g])
end
g.add_local_property(self, impls)
end
end
g.add_local_property(self, impls)
end