[SR-10300] Trying to implement default parameters via an extension for a class protocol crashes with stack overflow #52700
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
type checker
Area → compiler: Semantic analysis
Additional Detail from JIRA
md5: fc0fd85f901e012aa471ef2930c4ece7
Issue Description:
If you want to have a protocol with default parameters via an extension it works fine for straight protocols but you get a stackoverflow/recursion if it’s a class protocol.
This works fine and does what you’d expect
can simply call `bar()`
This will crash your app with a stack overflow
calling `bar()` will crash
We had two examples like this in the code. One worked and one didn’t the only difference was the class inheritance. Unfortunately you need class/AnyObject inheritance for weak delegates. I tried to reproduce this in a playground but I crashed the playground and I didn't save the file.
The text was updated successfully, but these errors were encountered: