Proper check for tyStatic[T] -> U conversions (#10382)

Drop the outer tyStatic shell then perform the check.

Fixes #7609
This commit is contained in:
LemonBoy 2019-01-21 17:27:36 +01:00 • committed by Andreas Rumpf
commit ae5d8fbd9d
2 changed files with 7 additions and 0 deletions

View file

@ -108,6 +108,8 @@ const
proc checkConvertible(c: PContext, castDest, src: PType): TConvStatus =
result = convOK
# We're interested in the inner type and not in the static tag
var src = src.skipTypes({tyStatic})
if sameType(castDest, src) and castDest.sym == src.sym:
# don't annoy conversions that may be needed on another processor:
if castDest.kind notin IntegralTypes+{tyRange}: