Open tristanlabelle opened 1 year ago
Looks like we binding type variable allocated for optional evaluation expression to the one that represents generic parameter and that ends up propagating "can be hole" trait to the former one without a fix.
cc @LucianoPAlmeida maybe interesting, I wonder if we need to change constraint generation for optional evaluation expression slightly to avoid this kind of problem.
I remember this one, is the propagation logic we have for optional evaluation right? Was taking a look at the comment and it was mainly for pattern context, but now that pattern variables are marked as holes this propagation is still needed? Maybe I am missing something or it still needed in general. What is the idea on adjusting CSGen logic?
Description The Swift compiler produces a fatal error when compiling a combination of generics and optionals.
Steps to reproduce Compile the following with
swiftc
:Output:
Expected behavior A diagnostic should be produced and the compiler should not
fatalError
Environment