diff --git a/BeefLibs/corlib/src/Reflection/AttributeInfo.bf b/BeefLibs/corlib/src/Reflection/AttributeInfo.bf index 3d5fc31f..fcb0985f 100644 --- a/BeefLibs/corlib/src/Reflection/AttributeInfo.bf +++ b/BeefLibs/corlib/src/Reflection/AttributeInfo.bf @@ -46,7 +46,8 @@ namespace System.Reflection { case .Int8, .UInt8, - .Char8: + .Char8, + .Boolean: let attrData = Decode!(data); args[argIdx] = scope:AttrBlock box attrData; case .Int16, diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index b4a4bed6..47b08c47 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -5723,7 +5723,8 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary& usedStrin PUSH_INT64(constant->mInt64); } else if ((constant->mTypeCode == BfTypeCode_Int32) || - (constant->mTypeCode == BfTypeCode_UInt32)) + (constant->mTypeCode == BfTypeCode_UInt32) || + (constant->mTypeCode == BfTypeCode_Char32)) { PUSH_INT32(constant->mInt32); } @@ -5733,12 +5734,15 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary& usedStrin PUSH_INT32(*(int*)&val); } else if ((constant->mTypeCode == BfTypeCode_Int16) || - (constant->mTypeCode == BfTypeCode_UInt16)) + (constant->mTypeCode == BfTypeCode_UInt16) || + (constant->mTypeCode == BfTypeCode_Char16)) { PUSH_INT16(constant->mInt16); } else if ((constant->mTypeCode == BfTypeCode_Int8) || - (constant->mTypeCode == BfTypeCode_UInt8)) + (constant->mTypeCode == BfTypeCode_UInt8) || + (constant->mTypeCode == BfTypeCode_Boolean) || + (constant->mTypeCode == BfTypeCode_Char8)) { PUSH_INT8(constant->mInt8); } diff --git a/IDEHelper/Tests/src/Reflection.bf b/IDEHelper/Tests/src/Reflection.bf index 16faae45..dcb9f05f 100644 --- a/IDEHelper/Tests/src/Reflection.bf +++ b/IDEHelper/Tests/src/Reflection.bf @@ -13,15 +13,17 @@ namespace Tests public float mB; public String mC; public String mD; + public bool mE; - public this(int32 a, float b, String c, String d = "D") + public this(int32 a, float b, String c, String d = "D", bool e = true) { - PrintF("this: %p A: %d B: %f", this, a, (double)b); + //PrintF("this: %p A: %d B: %f", this, a, (double)b); mA = a; mB = b; mC = c; mD = d; + mE = e; } } @@ -354,6 +356,7 @@ namespace Tests Test.Assert(attrA.mB == 22); Test.Assert(attrA.mC == "StrA"); Test.Assert(attrA.mD == "D"); + Test.Assert(attrA.mE == true); } fieldIdx++;