bcc icon indicating copy to clipboard operation
bcc copied to clipboard

Incorrect variance checks when converting between function types

Open HurryStarfish opened this issue 9 months ago • 0 comments

Bug Report

It seems bcc has the co- and contravariance for return types and parameter types backwards when checking whether a function type is assignable from another.

Expected Behavior

Local f:String(s:Object)
Local f_:Object(o:String) = f

should compile without complaints.

Local f:Object(o:String)
Local f_:String(s:Object) = f

should be a type error.

Actual Behavior

It's the other way round

HurryStarfish avatar May 26 '24 15:05 HurryStarfish