From b8a96f9a8dae4f94770d1a669e212f4cab31a065 Mon Sep 17 00:00:00 2001 From: Daniel Murphy Date: Wed, 27 Aug 2014 00:22:41 +1000 Subject: [PATCH] Merge pull request #3901 from 9rnsr/fix13353 [REG2.066] Issue 13353 - [ICE] assertion with is() and templated interface --- src/class.c | 9 +++++++++ test/runnable/testclass.d | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/class.c b/src/class.c index 994cc2d4ee5b..3ea309224577 100644 --- a/src/class.c +++ b/src/class.c @@ -1359,6 +1359,14 @@ void InterfaceDeclaration::semantic(Scope *sc) i++; } + if (doAncestorsSemantic == SemanticDone) + { + //printf("%s already semantic analyzed, semanticRun = %d\n", toChars(), semanticRun); + if (semanticRun >= PASSsemanticdone) + return; + goto Lancestorsdone; + } + if (!baseclasses->dim && sc->linkage == LINKcpp) cpp = true; @@ -1443,6 +1451,7 @@ void InterfaceDeclaration::semantic(Scope *sc) cpp = true; } } +Lancestorsdone: if (!members) // if opaque declaration { diff --git a/test/runnable/testclass.d b/test/runnable/testclass.d index 66a7dff50d73..ac0aba317ed7 100644 --- a/test/runnable/testclass.d +++ b/test/runnable/testclass.d @@ -38,6 +38,24 @@ class Type12143 : Node12143 {} class Class12143 : Type12143 {} +/***************************************************/ +// 13353 + +interface Base13353(T) +{ + static assert(is(T : Base13353!T)); +} + +interface Derived13353 : Base13353!Derived13353 +{ + void func(); +} + +class Concrete13353 : Derived13353 +{ + void func() {} +} + /***************************************************/ int main()