eclipse-archived / ceylon-sdk

Standard platform modules belonging to the Ceylon SDK
http://www.ceylon-lang.org
Apache License 2.0
72 stars 60 forks source link

assertThateException -> ExceptionAssert can't handle member exception classes #729

Open Voiteh opened 5 years ago

Voiteh commented 5 years ago

When passing MemberClass reference to ExceptionAssert.hasType It fails to compile as typeCondition requires Class<Throwable,Nothing>|Boolean(ClassModel<Throwable,Nothing>) The first union case should be ClassModel<Throwable,Nothing>

Example:

mport ceylon.test {

    test,
    assertThatException
}
class Outer{
    static class Inner() extends Exception(){}
    shared new(){}
    shared void functionWhichThrows(){
        throw Inner();
    }
}

shared test void shouldCompile(){
    assertThatException(()=> Outer().functionWhichThrows()).hasType(`Outer.Inner`);
}