From 6806c3b63c4c3c72c1c07c5717abae44355337b0 Mon Sep 17 00:00:00 2001 From: Daniel Sainati Date: Fri, 15 Dec 2023 16:31:00 -0500 Subject: [PATCH] use new isPrimitiveType function --- runtime/sema/check_composite_declaration.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/runtime/sema/check_composite_declaration.go b/runtime/sema/check_composite_declaration.go index d87bf49b7f..d16a5e888e 100644 --- a/runtime/sema/check_composite_declaration.go +++ b/runtime/sema/check_composite_declaration.go @@ -2046,14 +2046,9 @@ func (checker *Checker) checkDefaultDestroyEventParam( } param.DefaultArgument = checker.VisitExpression(paramDefaultArgument, paramType) - unwrappedParamType := UnwrapOptionalType(paramType) // default events must have default arguments for all their parameters; this is enforced in the parser // we want to check that these arguments are all either literals or field accesses, and have primitive types - if !IsSubType(unwrappedParamType, StringType) && - !IsSubType(unwrappedParamType, NumberType) && - !IsSubType(unwrappedParamType, TheAddressType) && - !IsSubType(unwrappedParamType, PathType) && - !IsSubType(unwrappedParamType, BoolType) { + if !paramType.IsPrimitiveType() { checker.report(&DefaultDestroyInvalidParameterError{ ParamType: paramType, Range: ast.NewRangeFromPositioned(checker.memoryGauge, astParam),