Ver Fonte

Splat fixes

Brian Fiete há 3 anos atrás
pai
commit
ab4719422a

+ 3 - 1
IDEHelper/Compiler/BfExprEvaluator.cpp

@@ -9215,7 +9215,9 @@ BfTypedValue BfExprEvaluator::MatchMethod(BfAstNode* targetSrc, BfMethodBoundExp
 			}
 		}
 
-		if ((!target.mType->IsGenericParam()) && (!target.IsSplat()) && (!IsVar(target.mType)))
+		if ((!target.mType->IsGenericParam()) &&
+			((!target.IsSplat()) || (target.mType->IsWrappableType())) &&
+			(!IsVar(target.mType)))
 			target = MakeCallableTarget(targetSrc, target);
 	}
 

+ 2 - 0
IDEHelper/Compiler/BfModule.cpp

@@ -18124,6 +18124,8 @@ void BfModule::EmitCtorBody(bool& skipBody)
 				{
 					auto thisVal = GetThis();
 					auto fieldPtr = mBfIRBuilder->CreateInBoundsGEP(thisVal.mValue, 0, fieldInstance.mDataIdx);
+					if (mCurTypeInstance->IsUnion())
+						fieldPtr = mBfIRBuilder->CreateBitCast(fieldPtr, mBfIRBuilder->GetPointerTo(mBfIRBuilder->MapType(fieldInstance.mResolvedType)));
 					mBfIRBuilder->CreateAlignedStore(localVal.mValue, fieldPtr, localVar->mResolvedType->mAlign);
 				}
 				MarkFieldInitialized(&fieldInstance);