From b812bcd94b1a214dcb572de5e3c5f6c213cec2c4 Mon Sep 17 00:00:00 2001 From: PetervB Date: Thu, 13 Nov 2014 17:31:02 +0100 Subject: [PATCH 1/2] Fixed annotation for ClassType --- milestone2-analysis/day7.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/milestone2-analysis/day7.md b/milestone2-analysis/day7.md index 5a6f8ff70e98..16dda08a9407 100644 --- a/milestone2-analysis/day7.md +++ b/milestone2-analysis/day7.md @@ -116,7 +116,7 @@ Consider the following test case as an example: ]] resolve #1 to #2 The type of the callee expression determines the class in which the method declaration can be found. -In this example, the expression `new Foo()` is of type `ClassType("Foo")` and +In this example, the expression `new Foo()` is of type `ClassType("Foo"{_})` and the corresponding class `Foo` contains a method declaration for `run()`. You should come up with test cases for the resolution of method names. From a6a20b27df8aa47be99392bc66c6aa9a5aba0139 Mon Sep 17 00:00:00 2001 From: PetervB Date: Tue, 18 Nov 2014 16:00:42 +0100 Subject: [PATCH 2/2] Added extra explanation on the use of annotations in ClassType --- milestone2-analysis/day7.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/milestone2-analysis/day7.md b/milestone2-analysis/day7.md index 16dda08a9407..bff1d98f953b 100644 --- a/milestone2-analysis/day7.md +++ b/milestone2-analysis/day7.md @@ -92,6 +92,18 @@ and a variable reference to be of its declared type `Bool()`: You can use `setup` headers and footers to avoid repeating parts in similar test cases. +When using get-type on objects the expected ClassType constructor also requires annotations. +These annotations should be added to the constructor using a wild card as done below. + + test expression id type [[ + class Foobar { + Foo x; + public Foo method() { + return [[x]]; + } + } + ]] run get-type to ClassType("Foo"{_}) + You should come up with test cases for the types of all kinds of expressions. Just like previous testing assignments, this assignment is all about the coverage of your test suite.