From 3c55e8c5278cdd9a6b16cac2403a296923c7c89b Mon Sep 17 00:00:00 2001 From: gavinking Date: Sun, 29 Nov 2015 23:05:54 +0100 Subject: [PATCH] fix #4566 --- .../typechecker/analyzer/TypeArgumentVisitor.java | 8 ++++++++ typechecker/test/main/cases/enumeratedbounds.ceylon | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/typechecker/src/com/redhat/ceylon/compiler/typechecker/analyzer/TypeArgumentVisitor.java b/typechecker/src/com/redhat/ceylon/compiler/typechecker/analyzer/TypeArgumentVisitor.java index 5f40133f454..d756a2d2d22 100644 --- a/typechecker/src/com/redhat/ceylon/compiler/typechecker/analyzer/TypeArgumentVisitor.java +++ b/typechecker/src/com/redhat/ceylon/compiler/typechecker/analyzer/TypeArgumentVisitor.java @@ -43,6 +43,14 @@ private void flip() { check(type, false, null); } } + Tree.CaseTypes cts = + that.getCaseTypes(); + if (cts!=null) { + for (Tree.Type type: cts.getTypes()) { + //TODO: is "null" really correct here?! + check(type, false, null); + } + } flip(); parameterizedDeclaration = null; } diff --git a/typechecker/test/main/cases/enumeratedbounds.ceylon b/typechecker/test/main/cases/enumeratedbounds.ceylon index 17229fa2f9e..dbf17438156 100644 --- a/typechecker/test/main/cases/enumeratedbounds.ceylon +++ b/typechecker/test/main/cases/enumeratedbounds.ceylon @@ -29,4 +29,11 @@ void testEnumeratedBounds() { @error Foo(); } -void brokenEnumBound() @error given O of true|false {} \ No newline at end of file +void brokenEnumBound() @error given O of true|false {} + +class Lizt() { + shared Item add(InItem i) + @error given InItem of Item { + return i of Item; + } +} \ No newline at end of file