From b0ec5137a11f931be700f2060d0f9c905065c41e Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Thu, 14 Aug 2014 13:37:00 -0400 Subject: [PATCH] src: add some asserts on `super` related things Signed-off-by: Jean Privat --- src/abstract_compiler.nit | 3 +++ src/rapid_type_analysis.nit | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/abstract_compiler.nit b/src/abstract_compiler.nit index 04ce034..6656d5b 100644 --- a/src/abstract_compiler.nit +++ b/src/abstract_compiler.nit @@ -1829,6 +1829,7 @@ redef class AMethPropdef if auto_super_inits != null then var args = [arguments.first] for auto_super_init in auto_super_inits do + assert auto_super_init.mproperty != mpropdef.mproperty args.clear for i in [0..auto_super_init.msignature.arity+1[ do args.add(arguments[i]) @@ -1852,6 +1853,8 @@ redef class AMethPropdef else compile_externmeth_to_c(v, mpropdef, arguments) end + else + abort end end diff --git a/src/rapid_type_analysis.nit b/src/rapid_type_analysis.nit index 2a4e8f2..31f4015 100644 --- a/src/rapid_type_analysis.nit +++ b/src/rapid_type_analysis.nit @@ -239,6 +239,7 @@ class RapidTypeAnalysis # It is an init for a class? if mmeth.name == "init" then var nclassdef = self.modelbuilder.mclassdef2nclassdef[mmethoddef.mclassdef] + assert mmethoddef == nclassdef.mfree_init var super_inits = nclassdef.super_inits if super_inits != null then #assert args.length == 1 @@ -422,6 +423,7 @@ class RapidTypeAnalysis fun add_super_send(recv: MType, mpropdef: MMethodDef) do + assert mpropdef.has_supercall if live_super_sends.has(mpropdef) then return #print "new super prop: {mpropdef}" live_super_sends.add(mpropdef) -- 1.7.9.5