summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortotycro <totycro@unknown-horizons.org>2011-06-26 12:59:41 +0200
committertotycro <totycro@unknown-horizons.org>2011-06-26 12:59:41 +0200
commit100b45d7bd6f81a7bc870b655c045ea5c84c1388 (patch)
tree42c1e019c174e5e79a6e1f6e14b0e8bff76335ef
parent067c154edb5280ce6f1a296aa18c0327ac9eb0f8 (diff)
downloadfoop-100b45d7bd6f81a7bc870b655c045ea5c84c1388.tar.gz
foop-100b45d7bd6f81a7bc870b655c045ea5c84c1388.tar.bz2
foop-100b45d7bd6f81a7bc870b655c045ea5c84c1388.zip
Auskommentieren kovariant-fail eingebaut
-rw-r--r--bank-eiffel/bank.e20
1 files changed, 20 insertions, 0 deletions
diff --git a/bank-eiffel/bank.e b/bank-eiffel/bank.e
index 223f60f..67ee067 100644
--- a/bank-eiffel/bank.e
+++ b/bank-eiffel/bank.e
@@ -53,8 +53,28 @@ feature {NONE} -- Initialization
53 53
54feature -- Basic operations 54feature -- Basic operations
55 55
56 fail_kovariant
57 local
58 r1: RETIREE
59 s1: STUDENT
60 stdAcc1: STUDENTACCOUNT
61 acc1: ACCOUNT
62
63 do
64 -- studi account mit normalen studi erstellen
65 create r1.make("a", "b")
66 create s1.make("a", "b")
67 create stdAcc1.make (s1, 0.01, 0.02, -50.0, [0.01, 0.022], [0.01, 0.02], [-100.0, -50.0])
68 acc1 := stdAcc1 -- upcast, acc1 erwartet PERSON
69 -- kompiler akzeptiert das folgende, weil PERSON erwartet wird
70 -- eigtl ist es eben ein studi acc, der RETIREES nicht akzeptiert, also laufzeitfehler
71 acc1.add_authorized_signer (r1)
72 end
73
56 session 74 session
57 do 75 do
76 -- das auskommentieren, dann bekommt ihr eine exception wegen kovariant (das ist ein methodenaufruf):
77 --fail_kovariant
58 from 78 from
59 until 79 until
60 over 80 over