kotlin icon indicating copy to clipboard operation
kotlin copied to clipboard

[FIR] Resolve annotations inside contracts

Open isuckatcs opened this issue 8 months ago • 2 comments

^KT-68893 Fixed

Inside a contract annotations are not resolved which results in an internal error.

I might be missing something, but seemingly both contract and bar are functions in the language, so I'm not sure why we need a different rule for annotations within contracts.

fun bar(block: () -> Unit) {
    block();
}

fun foo() {
    contract {
        @foo // fun contact() -> @foo
    }
    
    bar {
        @foo // fun bar() -> @foo
    }
}

I haven't seen any new tests failing by removing the overrides. It might be possible though that now the CFG contrains edges, it shouldn't. In that case I guess, we can just resolve the type of the annotation in the overridden methods and return.

isuckatcs avatar Jun 07 '24 18:06 isuckatcs