sema

package
v1.0.0-preview.41 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Int8TypeSize    uint = 1
	UInt8TypeSize   uint = 1
	Word8TypeSize   uint = 1
	Int16TypeSize   uint = 2
	UInt16TypeSize  uint = 2
	Word16TypeSize  uint = 2
	Int32TypeSize   uint = 4
	UInt32TypeSize  uint = 4
	Word32TypeSize  uint = 4
	Int64TypeSize   uint = 8
	UInt64TypeSize  uint = 8
	Word64TypeSize  uint = 8
	Fix64TypeSize   uint = 8
	UFix64TypeSize  uint = 8
	Int128TypeSize  uint = 16
	UInt128TypeSize uint = 16
	Int256TypeSize  uint = 32
	UInt256TypeSize uint = 32
)

size constants (in bytes) for fixed-width numeric types

View Source
const (
	FunctionPurityImpure = iota
	FunctionPurityView
)
View Source
const (
	NumberTypeName                   = "Number"
	SignedNumberTypeName             = "SignedNumber"
	IntegerTypeName                  = "Integer"
	SignedIntegerTypeName            = "SignedInteger"
	FixedSizeUnsignedIntegerTypeName = "FixedSizeUnsignedInteger"
	FixedPointTypeName               = "FixedPoint"
	SignedFixedPointTypeName         = "SignedFixedPoint"

	IntTypeName    = "Int"
	Int8TypeName   = "Int8"
	Int16TypeName  = "Int16"
	Int32TypeName  = "Int32"
	Int64TypeName  = "Int64"
	Int128TypeName = "Int128"
	Int256TypeName = "Int256"

	UIntTypeName    = "UInt"
	UInt8TypeName   = "UInt8"
	UInt16TypeName  = "UInt16"
	UInt32TypeName  = "UInt32"
	UInt64TypeName  = "UInt64"
	UInt128TypeName = "UInt128"
	UInt256TypeName = "UInt256"

	Word8TypeName   = "Word8"
	Word16TypeName  = "Word16"
	Word32TypeName  = "Word32"
	Word64TypeName  = "Word64"
	Word128TypeName = "Word128"
	Word256TypeName = "Word256"

	Fix64TypeName  = "Fix64"
	UFix64TypeName = "UFix64"
)
View Source
const AccountCapabilityControllerTypeBorrowTypeFieldDocString = `
The type of the controlled capability, i.e. the T in ` + "`Capability<T>`" + `.
`
View Source
const AccountCapabilityControllerTypeBorrowTypeFieldName = "borrowType"
View Source
const AccountCapabilityControllerTypeCapabilityFieldDocString = `
The capability that is controlled by this controller.
`
View Source
const AccountCapabilityControllerTypeCapabilityFieldName = "capability"
View Source
const AccountCapabilityControllerTypeCapabilityIDFieldDocString = `
The identifier of the controlled capability.
All copies of a capability have the same ID.
`
View Source
const AccountCapabilityControllerTypeCapabilityIDFieldName = "capabilityID"
View Source
const AccountCapabilityControllerTypeDeleteFunctionDocString = `` /* 380-byte string literal not displayed */
View Source
const AccountCapabilityControllerTypeDeleteFunctionName = "delete"
View Source
const AccountCapabilityControllerTypeName = "AccountCapabilityController"
View Source
const AccountCapabilityControllerTypeSetTagFunctionDocString = `
Updates this controller's tag to the provided string
`
View Source
const AccountCapabilityControllerTypeSetTagFunctionName = "setTag"
View Source
const AccountCapabilityControllerTypeTagFieldDocString = `` /* 131-byte string literal not displayed */
View Source
const AccountCapabilityControllerTypeTagFieldName = "tag"
View Source
const AccountKeyHashAlgoFieldName = "hashAlgorithm"
View Source
const AccountKeyIsRevokedFieldName = "isRevoked"
View Source
const AccountKeyKeyIndexFieldName = "keyIndex"
View Source
const AccountKeyPublicKeyFieldName = "publicKey"
View Source
const AccountKeyTypeName = "AccountKey"
View Source
const AccountKeyWeightFieldName = "weight"
View Source
const AccountTypeAddressFieldDocString = `
The address of the account.
`
View Source
const AccountTypeAddressFieldName = "address"
View Source
const AccountTypeAvailableBalanceFieldDocString = `
The FLOW balance of the default vault of this account that is available to be moved.
`
View Source
const AccountTypeAvailableBalanceFieldName = "availableBalance"
View Source
const AccountTypeBalanceFieldDocString = `
The FLOW balance of the default vault of this account.
`
View Source
const AccountTypeBalanceFieldName = "balance"
View Source
const AccountTypeCapabilitiesFieldDocString = `
The capabilities of the account.
`
View Source
const AccountTypeCapabilitiesFieldName = "capabilities"
View Source
const AccountTypeContractsFieldDocString = `
The contracts deployed to the account.
`
View Source
const AccountTypeContractsFieldName = "contracts"
View Source
const AccountTypeInboxFieldDocString = `
The inbox allows bootstrapping (sending and receiving) capabilities.
`
View Source
const AccountTypeInboxFieldName = "inbox"
View Source
const AccountTypeKeysFieldDocString = `
The keys assigned to the account.
`
View Source
const AccountTypeKeysFieldName = "keys"
View Source
const AccountTypeName = "Account"
View Source
const AccountTypeStorageFieldDocString = `
The storage of the account.
`
View Source
const AccountTypeStorageFieldName = "storage"
View Source
const Account_AccountCapabilitiesTypeForEachControllerFunctionDocString = `
Iterate over all account capability controllers for all account capabilities,
passing a reference to each controller to the provided callback function.

Iteration is stopped early if the callback function returns ` + "`false`" + `.

If a new account capability controller is issued for the account,
or an existing account capability controller for the account is deleted,
then the callback must stop iteration by returning false.
Otherwise, iteration aborts.
`
View Source
const Account_AccountCapabilitiesTypeForEachControllerFunctionName = "forEachController"
View Source
const Account_AccountCapabilitiesTypeGetControllerFunctionDocString = `` /* 139-byte string literal not displayed */
View Source
const Account_AccountCapabilitiesTypeGetControllerFunctionName = "getController"
View Source
const Account_AccountCapabilitiesTypeGetControllersFunctionDocString = `
Get all capability controllers for all account capabilities.
`
View Source
const Account_AccountCapabilitiesTypeGetControllersFunctionName = "getControllers"
View Source
const Account_AccountCapabilitiesTypeIssueFunctionDocString = `
Issue/create a new account capability.
`
View Source
const Account_AccountCapabilitiesTypeIssueFunctionName = "issue"
View Source
const Account_AccountCapabilitiesTypeIssueWithTypeFunctionDocString = `
Issue/create a new account capability.
`
View Source
const Account_AccountCapabilitiesTypeIssueWithTypeFunctionName = "issueWithType"
View Source
const Account_AccountCapabilitiesTypeName = "AccountCapabilities"
View Source
const Account_CapabilitiesTypeAccountFieldDocString = `
The account capabilities of the account.
`
View Source
const Account_CapabilitiesTypeAccountFieldName = "account"
View Source
const Account_CapabilitiesTypeBorrowFunctionDocString = `
Borrows the capability at the given public path.
Returns nil if the capability does not exist, or cannot be borrowed using the given type.
The function is equivalent to ` + "`get(path).borrow()`" + `.
`
View Source
const Account_CapabilitiesTypeBorrowFunctionName = "borrow"
View Source
const Account_CapabilitiesTypeExistsFunctionDocString = `
Returns true if a capability exists at the given public path.
`
View Source
const Account_CapabilitiesTypeExistsFunctionName = "exists"
View Source
const Account_CapabilitiesTypeGetFunctionDocString = `
Returns the capability at the given public path.
If the capability does not exist,
or if the given type is not a supertype of the capability's borrow type,
returns an "invalid" capability with ID 0 that will always fail to ` + "`check`" + ` or ` + "`borrow`" + `
`
View Source
const Account_CapabilitiesTypeGetFunctionName = "get"
View Source
const Account_CapabilitiesTypeName = "Capabilities"
View Source
const Account_CapabilitiesTypePublishFunctionDocString = `
Publish the capability at the given public path.

If there is already a capability published under the given path, the program aborts.

The path must be a public path, i.e., only the domain ` + "`public`" + ` is allowed.
`
View Source
const Account_CapabilitiesTypePublishFunctionName = "publish"
View Source
const Account_CapabilitiesTypeStorageFieldDocString = `
The storage capabilities of the account.
`
View Source
const Account_CapabilitiesTypeStorageFieldName = "storage"
View Source
const Account_CapabilitiesTypeUnpublishFunctionDocString = `` /* 169-byte string literal not displayed */
View Source
const Account_CapabilitiesTypeUnpublishFunctionName = "unpublish"
View Source
const Account_ContractsTypeAddFunctionDocString = `
Adds the given contract to the account.

The ` + "`code`" + ` parameter is the UTF-8 encoded representation of the source code.
The code must contain exactly one contract or contract interface,
which must have the same name as the ` + "`name`" + ` parameter.

All additional arguments that are given are passed further to the initializer
of the contract that is being deployed.

The function fails if a contract/contract interface with the given name already exists in the account,
if the given code does not declare exactly one contract or contract interface,
or if the given name does not match the name of the contract/contract interface declaration in the code.

Returns the deployed contract.
`
View Source
const Account_ContractsTypeAddFunctionName = "add"
View Source
const Account_ContractsTypeBorrowFunctionDocString = `` /* 225-byte string literal not displayed */
View Source
const Account_ContractsTypeBorrowFunctionName = "borrow"
View Source
const Account_ContractsTypeGetFunctionDocString = `` /* 201-byte string literal not displayed */
View Source
const Account_ContractsTypeGetFunctionName = "get"
View Source
const Account_ContractsTypeName = "Contracts"
View Source
const Account_ContractsTypeNamesFieldDocString = `
The names of all contracts deployed in the account.
`
View Source
const Account_ContractsTypeNamesFieldName = "names"
View Source
const Account_ContractsTypeRemoveFunctionDocString = `` /* 230-byte string literal not displayed */
View Source
const Account_ContractsTypeRemoveFunctionName = "remove"
View Source
const Account_ContractsTypeTryUpdateFunctionDocString = `
Updates the code for the contract/contract interface in the account,
and handle any deployment errors gracefully.

The ` + "`code`" + ` parameter is the UTF-8 encoded representation of the source code.
The code must contain exactly one contract or contract interface,
which must have the same name as the ` + "`name`" + ` parameter.

Does **not** run the initializer of the contract/contract interface again.
The contract instance in the world state stays as is.

Fails if no contract/contract interface with the given name exists in the account,
if the given code does not declare exactly one contract or contract interface,
or if the given name does not match the name of the contract/contract interface declaration in the code.

Returns the deployment result.
Result would contain the deployed contract for the updated contract, if the update was successfull.
Otherwise, the deployed contract would be nil.
`
View Source
const Account_ContractsTypeTryUpdateFunctionName = "tryUpdate"
View Source
const Account_ContractsTypeUpdateFunctionDocString = `
Updates the code for the contract/contract interface in the account.

The ` + "`code`" + ` parameter is the UTF-8 encoded representation of the source code.
The code must contain exactly one contract or contract interface,
which must have the same name as the ` + "`name`" + ` parameter.

Does **not** run the initializer of the contract/contract interface again.
The contract instance in the world state stays as is.

Fails if no contract/contract interface with the given name exists in the account,
if the given code does not declare exactly one contract or contract interface,
or if the given name does not match the name of the contract/contract interface declaration in the code.

Returns the deployed contract for the updated contract.
`
View Source
const Account_ContractsTypeUpdateFunctionName = "update"
View Source
const Account_InboxTypeClaimFunctionDocString = `
Claims a Capability previously published by the specified provider.

Returns ` + "`nil`" + ` if no Capability is published under the given name,
or if this account is not its intended recipient.

Errors if the Capability under that name does not match the provided type.
`
View Source
const Account_InboxTypeClaimFunctionName = "claim"
View Source
const Account_InboxTypeName = "Inbox"
View Source
const Account_InboxTypePublishFunctionDocString = `
Publishes a new Capability under the given name,
to be claimed by the specified recipient.
`
View Source
const Account_InboxTypePublishFunctionName = "publish"
View Source
const Account_InboxTypeUnpublishFunctionDocString = `
Unpublishes a Capability previously published by this account.

Returns ` + "`nil`" + ` if no Capability is published under the given name.

Errors if the Capability under that name does not match the provided type.
`
View Source
const Account_InboxTypeUnpublishFunctionName = "unpublish"
View Source
const Account_KeysTypeAddFunctionDocString = `
Adds a new key with the given hashing algorithm and a weight.

Returns the added key.
`
View Source
const Account_KeysTypeAddFunctionName = "add"
View Source
const Account_KeysTypeCountFieldDocString = `
The total number of unrevoked keys in this account.
`
View Source
const Account_KeysTypeCountFieldName = "count"
View Source
const Account_KeysTypeForEachFunctionDocString = `
Iterate over all unrevoked keys in this account,
passing each key in turn to the provided function.

Iteration is stopped early if the function returns ` + "`false`" + `.

The order of iteration is undefined.
`
View Source
const Account_KeysTypeForEachFunctionName = "forEach"
View Source
const Account_KeysTypeGetFunctionDocString = `
Returns the key at the given index, if it exists, or nil otherwise.

Revoked keys are always returned, but they have ` + "`isRevoked`" + ` field set to true.
`
View Source
const Account_KeysTypeGetFunctionName = "get"
View Source
const Account_KeysTypeName = "Keys"
View Source
const Account_KeysTypeRevokeFunctionDocString = `
Marks the key at the given index revoked, but does not delete it.

Returns the revoked key if it exists, or nil otherwise.
`
View Source
const Account_KeysTypeRevokeFunctionName = "revoke"
View Source
const Account_StorageCapabilitiesTypeForEachControllerFunctionDocString = `
Iterate over all storage capability controllers for capabilities that target this storage path,
passing a reference to each controller to the provided callback function.

Iteration is stopped early if the callback function returns ` + "`false`" + `.

If a new storage capability controller is issued for the path,
an existing storage capability controller for the path is deleted,
or a storage capability controller is retargeted from or to the path,
then the callback must stop iteration by returning false.
Otherwise, iteration aborts.
`
View Source
const Account_StorageCapabilitiesTypeForEachControllerFunctionName = "forEachController"
View Source
const Account_StorageCapabilitiesTypeGetControllerFunctionDocString = `` /* 155-byte string literal not displayed */
View Source
const Account_StorageCapabilitiesTypeGetControllerFunctionName = "getController"
View Source
const Account_StorageCapabilitiesTypeGetControllersFunctionDocString = `
Get all storage capability controllers for capabilities that target this storage path
`
View Source
const Account_StorageCapabilitiesTypeGetControllersFunctionName = "getControllers"
View Source
const Account_StorageCapabilitiesTypeIssueFunctionDocString = `
Issue/create a new storage capability.
`
View Source
const Account_StorageCapabilitiesTypeIssueFunctionName = "issue"
View Source
const Account_StorageCapabilitiesTypeIssueWithTypeFunctionDocString = `
Issue/create a new storage capability.
`
View Source
const Account_StorageCapabilitiesTypeIssueWithTypeFunctionName = "issueWithType"
View Source
const Account_StorageCapabilitiesTypeName = "StorageCapabilities"
View Source
const Account_StorageTypeBorrowFunctionDocString = `
Returns a reference to an object in storage without removing it from storage.

If no object is stored under the given path, the function returns nil.
If there is an object stored, a reference is returned as an optional,
provided it can be borrowed using the given type.
If the stored object cannot be borrowed using the given type, the function panics.

The given type must not necessarily be exactly the same as the type of the borrowed object.

The path must be a storage path, i.e., only the domain ` + "`storage`" + ` is allowed
`
View Source
const Account_StorageTypeBorrowFunctionName = "borrow"
View Source
const Account_StorageTypeCapacityFieldDocString = `
The storage capacity of the account in bytes.
`
View Source
const Account_StorageTypeCapacityFieldName = "capacity"
View Source
const Account_StorageTypeCheckFunctionDocString = `
Returns true if the object in account storage under the given path satisfies the given type,
i.e. could be borrowed using the given type.

The given type must not necessarily be exactly the same as the type of the     borrowed object.

The path must be a storage path, i.e., only the domain ` + "`storage`" + ` is allowed.
`
View Source
const Account_StorageTypeCheckFunctionName = "check"
View Source
const Account_StorageTypeCopyFunctionDocString = `
Returns a copy of a structure stored in account storage under the given path,
without removing it from storage,
or nil if no object is stored under the given path.

If there is a structure stored, it is copied.
The structure stays stored in storage after the function returns.

The given type must be a supertype of the type of the copied structure.
If it is not, the function panics.

The given type must not necessarily be exactly the same as the type of the copied structure.

The path must be a storage path, i.e., only the domain ` + "`storage`" + ` is allowed.
`
View Source
const Account_StorageTypeCopyFunctionName = "copy"
View Source
const Account_StorageTypeForEachPublicFunctionDocString = `
Iterate over all the public paths of an account,
passing each path and type in turn to the provided callback function.

The callback function takes two arguments:
1. The path of the stored object
2. The runtime type of that object

Iteration is stopped early if the callback function returns ` + "`false`" + `.

The order of iteration is undefined.

If an object is stored under a new public path,
or an existing object is removed from a public path,
then the callback must stop iteration by returning false.
Otherwise, iteration aborts.
`
View Source
const Account_StorageTypeForEachPublicFunctionName = "forEachPublic"
View Source
const Account_StorageTypeForEachStoredFunctionDocString = `
Iterate over all the stored paths of an account,
passing each path and type in turn to the provided callback function.

The callback function takes two arguments:
1. The path of the stored object
2. The runtime type of that object

Iteration is stopped early if the callback function returns ` + "`false`" + `.

If an object is stored under a new storage path,
or an existing object is removed from a storage path,
then the callback must stop iteration by returning false.
Otherwise, iteration aborts.
`
View Source
const Account_StorageTypeForEachStoredFunctionName = "forEachStored"
View Source
const Account_StorageTypeLoadFunctionDocString = `
Loads an object from the account's storage which is stored under the given path,
or nil if no object is stored under the given path.

If there is an object stored,
the stored resource or structure is moved out of storage and returned as an optional.

When the function returns, the storage no longer contains an object under the given path.

The given type must be a supertype of the type of the loaded object.
If it is not, the function panics.

The given type must not necessarily be exactly the same as the type of the loaded object.

The path must be a storage path, i.e., only the domain ` + "`storage`" + ` is allowed.
`
View Source
const Account_StorageTypeLoadFunctionName = "load"
View Source
const Account_StorageTypeName = "Storage"
View Source
const Account_StorageTypePublicPathsFieldDocString = `
All public paths of this account.
`
View Source
const Account_StorageTypePublicPathsFieldName = "publicPaths"
View Source
const Account_StorageTypeSaveFunctionDocString = `
Saves the given object into the account's storage at the given path.

Resources are moved into storage, and structures are copied.

If there is already an object stored under the given path, the program aborts.

The path must be a storage path, i.e., only the domain ` + "`storage`" + ` is allowed.
`
View Source
const Account_StorageTypeSaveFunctionName = "save"
View Source
const Account_StorageTypeStoragePathsFieldDocString = `
All storage paths of this account.
`
View Source
const Account_StorageTypeStoragePathsFieldName = "storagePaths"
View Source
const Account_StorageTypeTypeFunctionDocString = `
Reads the type of an object from the account's storage which is stored under the given path,
or nil if no object is stored under the given path.

If there is an object stored, the type of the object is returned without modifying the stored object.

The path must be a storage path, i.e., only the domain ` + "`storage`" + ` is allowed.
`
View Source
const Account_StorageTypeTypeFunctionName = "type"
View Source
const Account_StorageTypeUsedFieldDocString = `
The current amount of storage used by the account in bytes.
`
View Source
const Account_StorageTypeUsedFieldName = "used"
View Source
const AddressTypeFromBytesFunctionDocString = `
Returns an Address from the given byte array
`
View Source
const AddressTypeFromBytesFunctionName = "fromBytes"
View Source
const AddressTypeFromStringFunctionDocString = `
Attempts to parse an Address from the input string. Returns nil on invalid input.
`
View Source
const AddressTypeFromStringFunctionName = "fromString"
View Source
const AddressTypeName = "Address"
View Source
const AddressTypeToBytesFunctionName = `toBytes`
View Source
const AnyResourceAttachmentTypeName = "AnyResourceAttachment"
View Source
const AnyStructAttachmentTypeName = "AnyStructAttachment"
View Source
const ArgumentLabelNotRequired = "_"
View Source
const ArrayTypeFilterFunctionName = "filter"
View Source
const ArrayTypeMapFunctionName = "map"
View Source
const ArrayTypeReverseFunctionName = "reverse"
View Source
const ArrayTypeToConstantSizedFunctionName = "toConstantSized"
View Source
const ArrayTypeToVariableSizedFunctionName = "toVariableSized"
View Source
const BaseIdentifier = "base"
View Source
const BeforeIdentifier = "before"
View Source
const BlockTypeHeightFieldDocString = `` /* 184-byte string literal not displayed */
View Source
const BlockTypeHeightFieldName = "height"
View Source
const BlockTypeIdFieldDocString = `
The ID of the block.
It is essentially the hash of the block
`
View Source
const BlockTypeIdFieldName = "id"
View Source
const BlockTypeName = "Block"
View Source
const BlockTypeTimestampFieldDocString = `
Consider observing blocks' status changes off-chain yourself to get a more reliable value.
`
View Source
const BlockTypeTimestampFieldName = "timestamp"
View Source
const BlockTypeViewFieldDocString = `` /* 275-byte string literal not displayed */
View Source
const BlockTypeViewFieldName = "view"
View Source
const CapabilityTypeAddressFieldName = "address"
View Source
const CapabilityTypeBorrowFunctionName = "borrow"
View Source
const CapabilityTypeCheckFunctionName = "check"
View Source
const CapabilityTypeFunctionName = "CapabilityType"
View Source
const CapabilityTypeIDFieldName = "id"
View Source
const CharacterTypeName = "Character"
View Source
const CharacterTypeToStringFunctionDocString = `
Returns this character as a String.
`
View Source
const CharacterTypeToStringFunctionName = "toString"
View Source
const CharacterTypeUtf8FieldDocString = `
The byte array of the UTF-8 encoding.
`
View Source
const CharacterTypeUtf8FieldName = "utf8"
View Source
const CompositeForEachAttachmentFunctionName = "forEachAttachment"
View Source
const CompositeTypeFunctionName = "CompositeType"
View Source
const ConstantSizedArrayTypeFunctionName = "ConstantSizedArrayType"
View Source
const ContractAccountFieldName = "account"
View Source
const DeployedContractTypeAddressFieldDocString = `
The address of the account where the contract is deployed at.
`
View Source
const DeployedContractTypeAddressFieldName = "address"
View Source
const DeployedContractTypeCodeFieldDocString = `
The code of the contract.
`
View Source
const DeployedContractTypeCodeFieldName = "code"
View Source
const DeployedContractTypeName = "DeployedContract"
View Source
const DeployedContractTypeNameFieldDocString = `
The name of the contract.
`
View Source
const DeployedContractTypeNameFieldName = "name"
View Source
const DeployedContractTypePublicTypesFunctionDocString = `
Returns an array of ` + "`Type`" + ` objects representing all the public type declarations in this contract
(e.g. structs, resources, enums).

For example, given a contract
` + `
contract Foo {
access(all) struct Bar {...}
access(all) resource Qux {...}
}
` + `
then ` + "`.publicTypes()`" + ` will return an array equivalent to the expression ` + "`[Type<Bar>(), Type<Qux>()]`" + `
`
View Source
const DeployedContractTypePublicTypesFunctionName = "publicTypes"
View Source
const DeploymentResultTypeDeployedContractFieldDocString = `
The deployed contract.

If the the deployment was unsuccessfull, this will be nil.
`
View Source
const DeploymentResultTypeDeployedContractFieldName = "deployedContract"
View Source
const DeploymentResultTypeName = "DeploymentResult"
View Source
const DictionaryTypeFunctionName = "DictionaryType"
View Source
const EnumRawValueFieldName = "rawValue"
View Source
const Fix64Factor = fixedpoint.Fix64Factor
View Source
const Fix64Scale = fixedpoint.Fix64Scale
View Source
const Fix64TypeMaxFractional = fixedpoint.Fix64TypeMaxFractional
View Source
const Fix64TypeMaxInt = fixedpoint.Fix64TypeMaxInt
View Source
const Fix64TypeMinFractional = fixedpoint.Fix64TypeMinFractional
View Source
const Fix64TypeMinInt = fixedpoint.Fix64TypeMinInt
View Source
const FromBigEndianBytesFunctionName = "fromBigEndianBytes"
View Source
const FromStringFunctionName = "fromString"

fromString

View Source
const FunctionEntryPointName = "main"
View Source
const FunctionTypeFunctionName = "FunctionType"
View Source
const GetTypeFunctionName = "getType"
View Source
const HashAlgorithmDocStringKECCAK_256 = `` /* 187-byte string literal not displayed */
View Source
const HashAlgorithmDocStringKMAC128_BLS_BLS12_381 = `` /* 546-byte string literal not displayed */
View Source
const HashAlgorithmDocStringSHA2_256 = `
SHA2_256 is SHA-2 with a 256-bit digest (also referred to as SHA256)
`
View Source
const HashAlgorithmDocStringSHA2_384 = `
SHA2_384 is SHA-2 with a 384-bit digest (also referred to as  SHA384)
`
View Source
const HashAlgorithmDocStringSHA3_256 = `
SHA3_256 is SHA-3 with a 256-bit digest
`
View Source
const HashAlgorithmDocStringSHA3_384 = `
SHA3_384 is SHA-3 with a 384-bit digest
`
View Source
const HashAlgorithmTypeHashFunctionDocString = `
Returns the hash of the given data
`
View Source
const HashAlgorithmTypeHashFunctionName = "hash"
View Source
const HashAlgorithmTypeHashWithTagFunctionDocString = `
Returns the hash of the given data and tag
`
View Source
const HashAlgorithmTypeHashWithTagFunctionName = "hashWithTag"
View Source
const HashAlgorithmTypeName = "HashAlgorithm"
View Source
const HashableStructTypeName = "HashableStruct"
View Source
const IdentityMappingIdentifier string = "Identity"
View Source
const InclusiveRangeTypeContainsFunctionName = "contains"
View Source
const InclusiveRangeTypeEndFieldName = "end"
View Source
const InclusiveRangeTypeFunctionName = "InclusiveRangeType"
View Source
const InclusiveRangeTypeStartFieldName = "start"
View Source
const InclusiveRangeTypeStepFieldName = "step"
View Source
const IntersectionTypeFunctionName = "IntersectionType"
View Source
const IsInstanceFunctionName = "isInstance"
View Source
const MetaTypeIdentifierFieldName = "identifier"
View Source
const MetaTypeIsSubtypeFunctionName = "isSubtype"
View Source
const MetaTypeName = "Type"
View Source
const NumberTypeMaxFieldName = "max"
View Source
const NumberTypeMinFieldName = "min"
View Source
const NumericTypeSaturatingAddFunctionName = "saturatingAdd"
View Source
const NumericTypeSaturatingDivideFunctionName = "saturatingDivide"
View Source
const NumericTypeSaturatingMultiplyFunctionName = "saturatingMultiply"
View Source
const NumericTypeSaturatingSubtractFunctionName = "saturatingSubtract"
View Source
const OptionalTypeFunctionName = "OptionalType"
View Source
const OptionalTypeMapFunctionName = "map"
View Source
const PublicKeyTypeName = "PublicKey"
View Source
const PublicKeyTypePublicKeyFieldName = "publicKey"
View Source
const PublicKeyTypeSignAlgoFieldName = "signatureAlgorithm"
View Source
const PublicKeyTypeVerifyFunctionName = "verify"
View Source
const PublicKeyTypeVerifyPoPFunctionName = "verifyPoP"
View Source
const ReferenceTypeFunctionName = "ReferenceType"
View Source
const ResourceOwnerFieldName = "owner"
View Source
const ResourceUUIDFieldName = "uuid"
View Source
const ResultIdentifier = "result"
View Source
const SelfIdentifier = "self"
View Source
const SignatureAlgorithmDocStringBLS_BLS12_381 = `` /* 244-byte string literal not displayed */
View Source
const SignatureAlgorithmDocStringECDSA_P256 = `
ECDSA_P256 is ECDSA on the NIST P-256 curve
`
View Source
const SignatureAlgorithmDocStringECDSA_secp256k1 = `
ECDSA_secp256k1 is ECDSA on the secp256k1 curve
`
View Source
const SignatureAlgorithmTypeName = "SignatureAlgorithm"
View Source
const StorageCapabilityControllerTypeBorrowTypeFieldDocString = `
The type of the controlled capability, i.e. the T in ` + "`Capability<T>`" + `.
`
View Source
const StorageCapabilityControllerTypeBorrowTypeFieldName = "borrowType"
View Source
const StorageCapabilityControllerTypeCapabilityFieldDocString = `
The capability that is controlled by this controller.
`
View Source
const StorageCapabilityControllerTypeCapabilityFieldName = "capability"
View Source
const StorageCapabilityControllerTypeCapabilityIDFieldDocString = `
The identifier of the controlled capability.
All copies of a capability have the same ID.
`
View Source
const StorageCapabilityControllerTypeCapabilityIDFieldName = "capabilityID"
View Source
const StorageCapabilityControllerTypeDeleteFunctionDocString = `` /* 380-byte string literal not displayed */
View Source
const StorageCapabilityControllerTypeDeleteFunctionName = "delete"
View Source
const StorageCapabilityControllerTypeName = "StorageCapabilityController"
View Source
const StorageCapabilityControllerTypeRetargetFunctionDocString = `
Retarget the controlled capability to the given storage path.
The path may be different or the same as the current path.
`
View Source
const StorageCapabilityControllerTypeRetargetFunctionName = "retarget"
View Source
const StorageCapabilityControllerTypeSetTagFunctionDocString = `
Updates this controller's tag to the provided string
`
View Source
const StorageCapabilityControllerTypeSetTagFunctionName = "setTag"
View Source
const StorageCapabilityControllerTypeTagFieldDocString = `` /* 131-byte string literal not displayed */
View Source
const StorageCapabilityControllerTypeTagFieldName = "tag"
View Source
const StorageCapabilityControllerTypeTargetFunctionDocString = `
Returns the targeted storage path of the controlled capability.
`
View Source
const StorageCapabilityControllerTypeTargetFunctionName = "target"
View Source
const StringTypeConcatFunctionName = "concat"
View Source
const StringTypeContainsFunctionName = "contains"
View Source
const StringTypeCountFunctionName = "count"
View Source
const StringTypeDecodeHexFunctionName = "decodeHex"
View Source
const StringTypeEncodeHexFunctionDocString = `
Returns a hexadecimal string for the given byte array
`
View Source
const StringTypeEncodeHexFunctionName = "encodeHex"
View Source
const StringTypeFromCharactersFunctionDocString = `
Returns a string from the given array of characters
`
View Source
const StringTypeFromCharactersFunctionName = "fromCharacters"
View Source
const StringTypeFromUtf8FunctionDocString = `
Attempt to decode the input as a UTF-8 encoded string. Returns nil if the input bytes are malformed UTF-8
`
View Source
const StringTypeFromUtf8FunctionName = "fromUTF8"
View Source
const StringTypeIndexFunctionName = "index"
View Source
const StringTypeJoinFunctionDocString = `
Returns a string after joining the array of strings with the provided separator.
`
View Source
const StringTypeJoinFunctionName = "join"
View Source
const StringTypeLengthFieldName = "length"
View Source
const StringTypeReplaceAllFunctionDocString = `
Returns a new string after replacing all the occurrences of parameter ` + "`of` with the parameter `with`" + `.

If ` + "`with`" + ` is empty, it matches at the beginning of the string and after each UTF-8 sequence, yielding k+1 replacements for a string of length k.
`
View Source
const StringTypeReplaceAllFunctionName = "replaceAll"
View Source
const StringTypeSliceFunctionName = "slice"
View Source
const StringTypeSplitFunctionDocString = `
Returns a variable-sized array of strings after splitting the string on the delimiter.
`
View Source
const StringTypeSplitFunctionName = "split"
View Source
const StringTypeToLowerFunctionName = "toLower"
View Source
const StringTypeUtf8FieldName = "utf8"
View Source
const ToBigEndianBytesFunctionName = "toBigEndianBytes"
View Source
const ToStringFunctionName = "toString"
View Source
const TypeIDSeparator = '.'
View Source
const UFix64TypeMaxFractional = fixedpoint.UFix64TypeMaxFractional
View Source
const UFix64TypeMaxInt = fixedpoint.UFix64TypeMaxInt
View Source
const UFix64TypeMinFractional = fixedpoint.UFix64TypeMinFractional
View Source
const UFix64TypeMinInt = fixedpoint.UFix64TypeMinInt
View Source
const VariableSizedArrayTypeFunctionName = "VariableSizedArrayType"

Variables

View Source
var (

	// NumberType represents the super-type of all number types
	NumberType = NewNumericType(NumberTypeName).
				WithTag(NumberTypeTag).
				AsSuperType()

	NumberTypeAnnotation = NewTypeAnnotation(NumberType)

	// SignedNumberType represents the super-type of all signed number types
	SignedNumberType = NewNumericType(SignedNumberTypeName).
						WithTag(SignedNumberTypeTag).
						AsSuperType()

	SignedNumberTypeAnnotation = NewTypeAnnotation(SignedNumberType)

	// IntegerType represents the super-type of all integer types
	IntegerType = NewNumericType(IntegerTypeName).
				WithTag(IntegerTypeTag).
				AsSuperType()

	IntegerTypeAnnotation = NewTypeAnnotation(IntegerType)

	// SignedIntegerType represents the super-type of all signed integer types
	SignedIntegerType = NewNumericType(SignedIntegerTypeName).
						WithTag(SignedIntegerTypeTag).
						AsSuperType()

	SignedIntegerTypeAnnotation = NewTypeAnnotation(SignedIntegerType)

	// FixedSizeUnsignedIntegerType represents the super-type of all unsigned integer types which have a fixed size.
	FixedSizeUnsignedIntegerType = NewNumericType(FixedSizeUnsignedIntegerTypeName).
									WithTag(FixedSizeUnsignedIntegerTypeTag).
									AsSuperType()

	// IntType represents the arbitrary-precision integer type `Int`
	IntType = NewNumericType(IntTypeName).
			WithTag(IntTypeTag)

	IntTypeAnnotation = NewTypeAnnotation(IntType)

	// Int8Type represents the 8-bit signed integer type `Int8`
	Int8Type = NewNumericType(Int8TypeName).
				WithTag(Int8TypeTag).
				WithIntRange(Int8TypeMinInt, Int8TypeMaxInt).
				WithByteSize(1).
				WithSaturatingFunctions(SaturatingArithmeticSupport{
			Add:      true,
			Subtract: true,
			Multiply: true,
			Divide:   true,
		})

	Int8TypeAnnotation = NewTypeAnnotation(Int8Type)

	// Int16Type represents the 16-bit signed integer type `Int16`
	Int16Type = NewNumericType(Int16TypeName).
				WithTag(Int16TypeTag).
				WithIntRange(Int16TypeMinInt, Int16TypeMaxInt).
				WithByteSize(2).
				WithSaturatingFunctions(SaturatingArithmeticSupport{
			Add:      true,
			Subtract: true,
			Multiply: true,
			Divide:   true,
		})

	Int16TypeAnnotation = NewTypeAnnotation(Int16Type)

	// Int32Type represents the 32-bit signed integer type `Int32`
	Int32Type = NewNumericType(Int32TypeName).
				WithTag(Int32TypeTag).
				WithIntRange(Int32TypeMinInt, Int32TypeMaxInt).
				WithByteSize(4).
				WithSaturatingFunctions(SaturatingArithmeticSupport{
			Add:      true,
			Subtract: true,
			Multiply: true,
			Divide:   true,
		})

	Int32TypeAnnotation = NewTypeAnnotation(Int32Type)

	// Int64Type represents the 64-bit signed integer type `Int64`
	Int64Type = NewNumericType(Int64TypeName).
				WithTag(Int64TypeTag).
				WithIntRange(Int64TypeMinInt, Int64TypeMaxInt).
				WithByteSize(8).
				WithSaturatingFunctions(SaturatingArithmeticSupport{
			Add:      true,
			Subtract: true,
			Multiply: true,
			Divide:   true,
		})

	Int64TypeAnnotation = NewTypeAnnotation(Int64Type)

	// Int128Type represents the 128-bit signed integer type `Int128`
	Int128Type = NewNumericType(Int128TypeName).
				WithTag(Int128TypeTag).
				WithIntRange(Int128TypeMinIntBig, Int128TypeMaxIntBig).
				WithByteSize(16).
				WithSaturatingFunctions(SaturatingArithmeticSupport{
			Add:      true,
			Subtract: true,
			Multiply: true,
			Divide:   true,
		})

	Int128TypeAnnotation = NewTypeAnnotation(Int128Type)

	// Int256Type represents the 256-bit signed integer type `Int256`
	Int256Type = NewNumericType(Int256TypeName).
				WithTag(Int256TypeTag).
				WithIntRange(Int256TypeMinIntBig, Int256TypeMaxIntBig).
				WithByteSize(32).
				WithSaturatingFunctions(SaturatingArithmeticSupport{
			Add:      true,
			Subtract: true,
			Multiply: true,
			Divide:   true,
		})

	Int256TypeAnnotation = NewTypeAnnotation(Int256Type)

	// UIntType represents the arbitrary-precision unsigned integer type `UInt`
	UIntType = NewNumericType(UIntTypeName).
				WithTag(UIntTypeTag).
				WithIntRange(UIntTypeMin, nil).
				WithSaturatingFunctions(SaturatingArithmeticSupport{
			Subtract: true,
		})

	UIntTypeAnnotation = NewTypeAnnotation(UIntType)

	// UInt8Type represents the 8-bit unsigned integer type `UInt8`
	// which checks for overflow and underflow
	UInt8Type = NewNumericType(UInt8TypeName).
				WithTag(UInt8TypeTag).
				WithIntRange(UInt8TypeMinInt, UInt8TypeMaxInt).
				WithByteSize(1).
				WithSaturatingFunctions(SaturatingArithmeticSupport{
			Add:      true,
			Subtract: true,
			Multiply: true,
		})

	UInt8TypeAnnotation = NewTypeAnnotation(UInt8Type)

	// UInt16Type represents the 16-bit unsigned integer type `UInt16`
	// which checks for overflow and underflow
	UInt16Type = NewNumericType(UInt16TypeName).
				WithTag(UInt16TypeTag).
				WithIntRange(UInt16TypeMinInt, UInt16TypeMaxInt).
				WithByteSize(2).
				WithSaturatingFunctions(SaturatingArithmeticSupport{
			Add:      true,
			Subtract: true,
			Multiply: true,
		})

	UInt16TypeAnnotation = NewTypeAnnotation(UInt16Type)

	// UInt32Type represents the 32-bit unsigned integer type `UInt32`
	// which checks for overflow and underflow
	UInt32Type = NewNumericType(UInt32TypeName).
				WithTag(UInt32TypeTag).
				WithIntRange(UInt32TypeMinInt, UInt32TypeMaxInt).
				WithByteSize(4).
				WithSaturatingFunctions(SaturatingArithmeticSupport{
			Add:      true,
			Subtract: true,
			Multiply: true,
		})

	UInt32TypeAnnotation = NewTypeAnnotation(UInt32Type)

	// UInt64Type represents the 64-bit unsigned integer type `UInt64`
	// which checks for overflow and underflow
	UInt64Type = NewNumericType(UInt64TypeName).
				WithTag(UInt64TypeTag).
				WithIntRange(UInt64TypeMinInt, UInt64TypeMaxInt).
				WithByteSize(8).
				WithSaturatingFunctions(SaturatingArithmeticSupport{
			Add:      true,
			Subtract: true,
			Multiply: true,
		})

	UInt64TypeAnnotation = NewTypeAnnotation(UInt64Type)

	// UInt128Type represents the 128-bit unsigned integer type `UInt128`
	// which checks for overflow and underflow
	UInt128Type = NewNumericType(UInt128TypeName).
				WithTag(UInt128TypeTag).
				WithIntRange(UInt128TypeMinIntBig, UInt128TypeMaxIntBig).
				WithByteSize(16).
				WithSaturatingFunctions(SaturatingArithmeticSupport{
			Add:      true,
			Subtract: true,
			Multiply: true,
		})

	UInt128TypeAnnotation = NewTypeAnnotation(UInt128Type)

	// UInt256Type represents the 256-bit unsigned integer type `UInt256`
	// which checks for overflow and underflow
	UInt256Type = NewNumericType(UInt256TypeName).
				WithTag(UInt256TypeTag).
				WithIntRange(UInt256TypeMinIntBig, UInt256TypeMaxIntBig).
				WithByteSize(32).
				WithSaturatingFunctions(SaturatingArithmeticSupport{
			Add:      true,
			Subtract: true,
			Multiply: true,
		})

	UInt256TypeAnnotation = NewTypeAnnotation(UInt256Type)

	// Word8Type represents the 8-bit unsigned integer type `Word8`
	// which does NOT check for overflow and underflow
	Word8Type = NewNumericType(Word8TypeName).
				WithTag(Word8TypeTag).
				WithByteSize(1).
				WithIntRange(Word8TypeMinInt, Word8TypeMaxInt)

	Word8TypeAnnotation = NewTypeAnnotation(Word8Type)

	// Word16Type represents the 16-bit unsigned integer type `Word16`
	// which does NOT check for overflow and underflow
	Word16Type = NewNumericType(Word16TypeName).
				WithTag(Word16TypeTag).
				WithByteSize(2).
				WithIntRange(Word16TypeMinInt, Word16TypeMaxInt)

	Word16TypeAnnotation = NewTypeAnnotation(Word16Type)

	// Word32Type represents the 32-bit unsigned integer type `Word32`
	// which does NOT check for overflow and underflow
	Word32Type = NewNumericType(Word32TypeName).
				WithTag(Word32TypeTag).
				WithByteSize(4).
				WithIntRange(Word32TypeMinInt, Word32TypeMaxInt)

	Word32TypeAnnotation = NewTypeAnnotation(Word32Type)

	// Word64Type represents the 64-bit unsigned integer type `Word64`
	// which does NOT check for overflow and underflow
	Word64Type = NewNumericType(Word64TypeName).
				WithTag(Word64TypeTag).
				WithByteSize(8).
				WithIntRange(Word64TypeMinInt, Word64TypeMaxInt)

	Word64TypeAnnotation = NewTypeAnnotation(Word64Type)

	// Word128Type represents the 128-bit unsigned integer type `Word128`
	// which does NOT check for overflow and underflow
	Word128Type = NewNumericType(Word128TypeName).
				WithTag(Word128TypeTag).
				WithByteSize(16).
				WithIntRange(Word128TypeMinIntBig, Word128TypeMaxIntBig)

	Word128TypeAnnotation = NewTypeAnnotation(Word128Type)

	// Word256Type represents the 256-bit unsigned integer type `Word256`
	// which does NOT check for overflow and underflow
	Word256Type = NewNumericType(Word256TypeName).
				WithTag(Word256TypeTag).
				WithByteSize(32).
				WithIntRange(Word256TypeMinIntBig, Word256TypeMaxIntBig)

	Word256TypeAnnotation = NewTypeAnnotation(Word256Type)

	// FixedPointType represents the super-type of all fixed-point types
	FixedPointType = NewNumericType(FixedPointTypeName).
					WithTag(FixedPointTypeTag).
					AsSuperType()

	FixedPointTypeAnnotation = NewTypeAnnotation(FixedPointType)

	// SignedFixedPointType represents the super-type of all signed fixed-point types
	SignedFixedPointType = NewNumericType(SignedFixedPointTypeName).
							WithTag(SignedFixedPointTypeTag).
							AsSuperType()

	SignedFixedPointTypeAnnotation = NewTypeAnnotation(SignedFixedPointType)

	// Fix64Type represents the 64-bit signed decimal fixed-point type `Fix64`
	// which has a scale of Fix64Scale, and checks for overflow and underflow
	Fix64Type = NewFixedPointNumericType(Fix64TypeName).
				WithTag(Fix64TypeTag).
				WithIntRange(Fix64TypeMinIntBig, Fix64TypeMaxIntBig).
				WithFractionalRange(Fix64TypeMinFractionalBig, Fix64TypeMaxFractionalBig).
				WithScale(Fix64Scale).
				WithSaturatingFunctions(SaturatingArithmeticSupport{
			Add:      true,
			Subtract: true,
			Multiply: true,
			Divide:   true,
		})

	Fix64TypeAnnotation = NewTypeAnnotation(Fix64Type)

	// UFix64Type represents the 64-bit unsigned decimal fixed-point type `UFix64`
	// which has a scale of 1E9, and checks for overflow and underflow
	UFix64Type = NewFixedPointNumericType(UFix64TypeName).
				WithTag(UFix64TypeTag).
				WithIntRange(UFix64TypeMinIntBig, UFix64TypeMaxIntBig).
				WithFractionalRange(UFix64TypeMinFractionalBig, UFix64TypeMaxFractionalBig).
				WithScale(Fix64Scale).
				WithSaturatingFunctions(SaturatingArithmeticSupport{
			Add:      true,
			Subtract: true,
			Multiply: true,
		})

	UFix64TypeAnnotation = NewTypeAnnotation(UFix64Type)
)
View Source
var (
	Int8TypeMinInt = new(big.Int).SetInt64(math.MinInt8)
	Int8TypeMaxInt = new(big.Int).SetInt64(math.MaxInt8)

	Int16TypeMinInt = new(big.Int).SetInt64(math.MinInt16)
	Int16TypeMaxInt = new(big.Int).SetInt64(math.MaxInt16)

	Int32TypeMinInt = new(big.Int).SetInt64(math.MinInt32)
	Int32TypeMaxInt = new(big.Int).SetInt64(math.MaxInt32)

	Int64TypeMinInt = new(big.Int).SetInt64(math.MinInt64)
	Int64TypeMaxInt = new(big.Int).SetInt64(math.MaxInt64)

	Int128TypeMinIntBig = func() *big.Int {
		int128TypeMin := big.NewInt(-1)
		int128TypeMin.Lsh(int128TypeMin, 127)
		return int128TypeMin
	}()

	Int128TypeMaxIntBig = func() *big.Int {
		int128TypeMax := big.NewInt(1)
		int128TypeMax.Lsh(int128TypeMax, 127)
		int128TypeMax.Sub(int128TypeMax, big.NewInt(1))
		return int128TypeMax
	}()

	Int256TypeMinIntBig = func() *big.Int {
		int256TypeMin := big.NewInt(-1)
		int256TypeMin.Lsh(int256TypeMin, 255)
		return int256TypeMin
	}()

	Int256TypeMaxIntBig = func() *big.Int {
		int256TypeMax := big.NewInt(1)
		int256TypeMax.Lsh(int256TypeMax, 255)
		int256TypeMax.Sub(int256TypeMax, big.NewInt(1))
		return int256TypeMax
	}()

	UIntTypeMin = new(big.Int)

	UInt8TypeMinInt = new(big.Int)
	UInt8TypeMaxInt = new(big.Int).SetUint64(math.MaxUint8)

	UInt16TypeMinInt = new(big.Int)
	UInt16TypeMaxInt = new(big.Int).SetUint64(math.MaxUint16)

	UInt32TypeMinInt = new(big.Int)
	UInt32TypeMaxInt = new(big.Int).SetUint64(math.MaxUint32)

	UInt64TypeMinInt = new(big.Int)
	UInt64TypeMaxInt = new(big.Int).SetUint64(math.MaxUint64)

	UInt128TypeMinIntBig = new(big.Int)

	UInt128TypeMaxIntBig = func() *big.Int {
		uInt128TypeMax := big.NewInt(1)
		uInt128TypeMax.Lsh(uInt128TypeMax, 128)
		uInt128TypeMax.Sub(uInt128TypeMax, big.NewInt(1))
		return uInt128TypeMax

	}()

	UInt256TypeMinIntBig = new(big.Int)

	UInt256TypeMaxIntBig = func() *big.Int {
		uInt256TypeMax := big.NewInt(1)
		uInt256TypeMax.Lsh(uInt256TypeMax, 256)
		uInt256TypeMax.Sub(uInt256TypeMax, big.NewInt(1))
		return uInt256TypeMax
	}()

	Word8TypeMinInt = new(big.Int)
	Word8TypeMaxInt = new(big.Int).SetUint64(math.MaxUint8)

	Word16TypeMinInt = new(big.Int)
	Word16TypeMaxInt = new(big.Int).SetUint64(math.MaxUint16)

	Word32TypeMinInt = new(big.Int)
	Word32TypeMaxInt = new(big.Int).SetUint64(math.MaxUint32)

	Word64TypeMinInt = new(big.Int)
	Word64TypeMaxInt = new(big.Int).SetUint64(math.MaxUint64)

	// 1 << 128
	Word128TypeMaxIntPlusOneBig = func() *big.Int {
		word128TypeMaxPlusOne := big.NewInt(1)
		word128TypeMaxPlusOne.Lsh(word128TypeMaxPlusOne, 128)
		return word128TypeMaxPlusOne
	}()
	Word128TypeMinIntBig = new(big.Int)
	Word128TypeMaxIntBig = func() *big.Int {
		word128TypeMax := new(big.Int)
		word128TypeMax.Sub(Word128TypeMaxIntPlusOneBig, big.NewInt(1))
		return word128TypeMax
	}()

	// 1 << 256
	Word256TypeMaxIntPlusOneBig = func() *big.Int {
		word256TypeMaxPlusOne := big.NewInt(1)
		word256TypeMaxPlusOne.Lsh(word256TypeMaxPlusOne, 256)
		return word256TypeMaxPlusOne
	}()
	Word256TypeMinIntBig = new(big.Int)
	Word256TypeMaxIntBig = func() *big.Int {
		word256TypeMax := new(big.Int)
		word256TypeMax.Sub(Word256TypeMaxIntPlusOneBig, big.NewInt(1))
		return word256TypeMax
	}()

	Fix64FactorBig = new(big.Int).SetUint64(uint64(Fix64Factor))

	Fix64TypeMinIntBig = fixedpoint.Fix64TypeMinIntBig
	Fix64TypeMaxIntBig = fixedpoint.Fix64TypeMaxIntBig

	Fix64TypeMinFractionalBig = fixedpoint.Fix64TypeMinFractionalBig
	Fix64TypeMaxFractionalBig = fixedpoint.Fix64TypeMaxFractionalBig

	UFix64TypeMinIntBig = fixedpoint.UFix64TypeMinIntBig
	UFix64TypeMaxIntBig = fixedpoint.UFix64TypeMaxIntBig

	UFix64TypeMinFractionalBig = fixedpoint.UFix64TypeMinFractionalBig
	UFix64TypeMaxFractionalBig = fixedpoint.UFix64TypeMaxFractionalBig
)

Numeric type ranges

View Source
var (
	// NoTypeTag is a special tag to represent mask with no types included
	NoTypeTag = newTypeTagFromLowerMask(noTypeMask)

	SignedIntegerTypeTag = newTypeTagFromLowerMask(signedIntegerTypeMask).
							Or(IntTypeTag).
							Or(Int8TypeTag).
							Or(Int16TypeTag).
							Or(Int32TypeTag).
							Or(Int64TypeTag).
							Or(Int128TypeTag).
							Or(Int256TypeTag)

	FixedSizeUnsignedIntegerTypeTag = newTypeTagFromUpperMask(fixedSizeUnsignedIntegerTypeMask).
									Or(UInt8TypeTag).
									Or(UInt16TypeTag).
									Or(UInt32TypeTag).
									Or(UInt64TypeTag).
									Or(UInt128TypeTag).
									Or(UInt256TypeTag).
									Or(Word8TypeTag).
									Or(Word16TypeTag).
									Or(Word32TypeTag).
									Or(Word64TypeTag).
									Or(Word128TypeTag).
									Or(Word256TypeTag)

	UnsignedIntegerTypeTag = newTypeTagFromLowerMask(unsignedIntegerTypeMask).
							Or(UIntTypeTag).
							Or(FixedSizeUnsignedIntegerTypeTag)

	IntegerTypeTag = newTypeTagFromLowerMask(integerTypeMask).
					Or(SignedIntegerTypeTag).
					Or(UnsignedIntegerTypeTag)

	SignedFixedPointTypeTag = newTypeTagFromLowerMask(signedFixedPointTypeMask).
							Or(Fix64TypeTag)

	UnsignedFixedPointTypeTag = newTypeTagFromLowerMask(unsignedFixedPointTypeMask).
								Or(UFix64TypeTag)

	FixedPointTypeTag = newTypeTagFromLowerMask(fixedPointTypeMask).
						Or(SignedFixedPointTypeTag).
						Or(UnsignedFixedPointTypeTag)

	SignedNumberTypeTag = newTypeTagFromLowerMask(signedNumberTypeMask).
						Or(SignedIntegerTypeTag).
						Or(SignedFixedPointTypeTag)

	NumberTypeTag = newTypeTagFromLowerMask(numberTypeMask).
					Or(IntegerTypeTag).
					Or(FixedPointTypeTag).
					Or(SignedNumberTypeTag)

	UIntTypeTag    = newTypeTagFromLowerMask(uintTypeMask)
	UInt8TypeTag   = newTypeTagFromLowerMask(uint8TypeMask)
	UInt16TypeTag  = newTypeTagFromLowerMask(uint16TypeMask)
	UInt32TypeTag  = newTypeTagFromLowerMask(uint32TypeMask)
	UInt64TypeTag  = newTypeTagFromLowerMask(uint64TypeMask)
	UInt128TypeTag = newTypeTagFromLowerMask(uint128TypeMask)
	UInt256TypeTag = newTypeTagFromLowerMask(uint256TypeMask)

	IntTypeTag    = newTypeTagFromLowerMask(intTypeMask)
	Int8TypeTag   = newTypeTagFromLowerMask(int8TypeMask)
	Int16TypeTag  = newTypeTagFromLowerMask(int16TypeMask)
	Int32TypeTag  = newTypeTagFromLowerMask(int32TypeMask)
	Int64TypeTag  = newTypeTagFromLowerMask(int64TypeMask)
	Int128TypeTag = newTypeTagFromLowerMask(int128TypeMask)
	Int256TypeTag = newTypeTagFromLowerMask(int256TypeMask)

	Word8TypeTag   = newTypeTagFromLowerMask(word8TypeMask)
	Word16TypeTag  = newTypeTagFromLowerMask(word16TypeMask)
	Word32TypeTag  = newTypeTagFromLowerMask(word32TypeMask)
	Word64TypeTag  = newTypeTagFromLowerMask(word64TypeMask)
	Word128TypeTag = newTypeTagFromLowerMask(word128TypeMask)
	Word256TypeTag = newTypeTagFromLowerMask(word256TypeMask)

	Fix64TypeTag  = newTypeTagFromLowerMask(fix64TypeMask)
	UFix64TypeTag = newTypeTagFromLowerMask(ufix64TypeMask)

	StringTypeTag           = newTypeTagFromLowerMask(stringTypeMask)
	CharacterTypeTag        = newTypeTagFromLowerMask(characterTypeMask)
	BoolTypeTag             = newTypeTagFromLowerMask(boolTypeMask)
	NilTypeTag              = newTypeTagFromLowerMask(nilTypeMask)
	VoidTypeTag             = newTypeTagFromLowerMask(voidTypeMask)
	AddressTypeTag          = newTypeTagFromLowerMask(addressTypeMask)
	MetaTypeTag             = newTypeTagFromLowerMask(metaTypeMask)
	NeverTypeTag            = newTypeTagFromLowerMask(neverTypeMask)
	BlockTypeTag            = newTypeTagFromLowerMask(blockTypeMask)
	DeployedContractTypeTag = newTypeTagFromLowerMask(deployedContractMask)

	StoragePathTypeTag = newTypeTagFromLowerMask(storagePathTypeMask)
	PublicPathTypeTag  = newTypeTagFromLowerMask(publicPathTypeMask)
	PrivatePathTypeTag = newTypeTagFromLowerMask(privatePathTypeMask)

	CapabilityPathTypeTag = newTypeTagFromLowerMask(capabilityPathTypeMask).
							Or(PublicPathTypeTag).
							Or(PrivatePathTypeTag)

	PathTypeTag = newTypeTagFromLowerMask(pathTypeMask).
				Or(CapabilityPathTypeTag).
				Or(StoragePathTypeTag)

	ConstantSizedTypeTag = newTypeTagFromLowerMask(constantSizedTypeMask)
	VariableSizedTypeTag = newTypeTagFromLowerMask(variableSizedTypeMask)
	DictionaryTypeTag    = newTypeTagFromLowerMask(dictionaryTypeMask)
	CompositeTypeTag     = newTypeTagFromLowerMask(compositeTypeMask)
	ReferenceTypeTag     = newTypeTagFromLowerMask(referenceTypeMask)
	GenericTypeTag       = newTypeTagFromLowerMask(genericTypeMask)
	FunctionTypeTag      = newTypeTagFromUpperMask(functionTypeMask)
	InterfaceTypeTag     = newTypeTagFromUpperMask(interfaceTypeMask)

	IntersectionTypeTag                = newTypeTagFromUpperMask(intersectionTypeMask)
	CapabilityTypeTag                  = newTypeTagFromUpperMask(capabilityTypeMask)
	InclusiveRangeTypeTag              = newTypeTagFromUpperMask(inclusiveRangeTypeMask)
	InvalidTypeTag                     = newTypeTagFromUpperMask(invalidTypeMask)
	TransactionTypeTag                 = newTypeTagFromUpperMask(transactionTypeMask)
	AnyResourceAttachmentTypeTag       = newTypeTagFromUpperMask(anyResourceAttachmentMask)
	AnyStructAttachmentTypeTag         = newTypeTagFromUpperMask(anyStructAttachmentMask)
	StorageCapabilityControllerTypeTag = newTypeTagFromUpperMask(storageCapabilityControllerTypeMask)
	AccountCapabilityControllerTypeTag = newTypeTagFromUpperMask(accountCapabilityControllerTypeMask)

	HashableStructTypeTag = newTypeTagFromUpperMask(hashableStructMask).
							Or(AddressTypeTag).
							Or(NeverTypeTag).
							Or(BoolTypeTag).
							Or(CharacterTypeTag).
							Or(StringTypeTag).
							Or(MetaTypeTag).
							Or(NumberTypeTag).
							Or(PathTypeTag)

	// AnyStructTypeTag only includes the types that are pre-known
	// to belong to AnyStruct type. This is more of an optimization.
	// Other types (derived types such as collections, etc.) are not possible
	// to be included in the mask without knowing their member types.
	// Hence, they are checked on demand in `getSuperTypeOfDerivedTypes()`.
	AnyStructTypeTag = newTypeTagFromLowerMask(anyStructTypeMask).
						Or(AnyStructAttachmentTypeTag).
						Or(NeverTypeTag).
						Or(NumberTypeTag).
						Or(StringTypeTag).
						Or(ReferenceTypeTag).
						Or(NilTypeTag).
						Or(BoolTypeTag).
						Or(CharacterTypeTag).
						Or(VoidTypeTag).
						Or(MetaTypeTag).
						Or(PathTypeTag).
						Or(AddressTypeTag).
						Or(BlockTypeTag).
						Or(DeployedContractTypeTag).
						Or(CapabilityTypeTag).
						Or(FunctionTypeTag).
						Or(StorageCapabilityControllerTypeTag).
						Or(AccountCapabilityControllerTypeTag).
						Or(HashableStructTypeTag).
						Or(InclusiveRangeTypeTag)

	AnyResourceTypeTag = newTypeTagFromLowerMask(anyResourceTypeMask).
						Or(AnyResourceAttachmentTypeTag)

	AnyTypeTag = newTypeTagFromLowerMask(anyTypeMask).
				Or(AnyStructTypeTag).
				Or(AnyResourceTypeTag).
				Or(ConstantSizedTypeTag).
				Or(VariableSizedTypeTag).
				Or(DictionaryTypeTag).
				Or(GenericTypeTag).
				Or(InterfaceTypeTag).
				Or(TransactionTypeTag).
				Or(IntersectionTypeTag)
)
View Source
var AccountCapabilitiesType = &EntitlementType{
	Identifier: "AccountCapabilities",
}
View Source
var AccountCapabilityControllerType = &SimpleType{
	Name:          AccountCapabilityControllerTypeName,
	QualifiedName: AccountCapabilityControllerTypeName,
	TypeID:        AccountCapabilityControllerTypeName,
	TypeTag:       AccountCapabilityControllerTypeTag,
	IsResource:    false,
	Storable:      false,
	Primitive:     false,
	Equatable:     false,
	Comparable:    false,
	Exportable:    false,
	Importable:    false,
	ContainFields: true,
}
View Source
var AccountCapabilityControllerTypeAnnotation = NewTypeAnnotation(AccountCapabilityControllerType)
View Source
var AccountCapabilityControllerTypeBorrowTypeFieldType = MetaType
View Source
var AccountCapabilityControllerTypeCapabilityFieldType = &CapabilityType{}
View Source
var AccountCapabilityControllerTypeCapabilityIDFieldType = UInt64Type
View Source
var AccountCapabilityControllerTypeDeleteFunctionType = &FunctionType{
	ReturnTypeAnnotation: NewTypeAnnotation(
		VoidType,
	),
}
View Source
var AccountCapabilityControllerTypeSetTagFunctionType = &FunctionType{
	Parameters: []Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "tag",
			TypeAnnotation: NewTypeAnnotation(StringType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		VoidType,
	),
}
View Source
var AccountCapabilityControllerTypeTagFieldType = StringType
View Source
var AccountKeyType = func() *CompositeType {

	accountKeyType := &CompositeType{
		Identifier:        AccountKeyTypeName,
		Kind:              common.CompositeKindStructure,
		ImportableBuiltin: false,
	}

	const accountKeyKeyIndexFieldDocString = `The index of the account key`
	const accountKeyPublicKeyFieldDocString = `The public key of the account`
	const accountKeyHashAlgorithmFieldDocString = `The hash algorithm used by the public key`
	const accountKeyWeightFieldDocString = `The weight assigned to the public key`
	const accountKeyIsRevokedFieldDocString = `Flag indicating whether the key is revoked`

	var members = []*Member{
		NewUnmeteredPublicConstantFieldMember(
			accountKeyType,
			AccountKeyKeyIndexFieldName,
			IntType,
			accountKeyKeyIndexFieldDocString,
		),
		NewUnmeteredPublicConstantFieldMember(
			accountKeyType,
			AccountKeyPublicKeyFieldName,
			PublicKeyType,
			accountKeyPublicKeyFieldDocString,
		),
		NewUnmeteredPublicConstantFieldMember(
			accountKeyType,
			AccountKeyHashAlgoFieldName,
			HashAlgorithmType,
			accountKeyHashAlgorithmFieldDocString,
		),
		NewUnmeteredPublicConstantFieldMember(
			accountKeyType,
			AccountKeyWeightFieldName,
			UFix64Type,
			accountKeyWeightFieldDocString,
		),
		NewUnmeteredPublicConstantFieldMember(
			accountKeyType,
			AccountKeyIsRevokedFieldName,
			BoolType,
			accountKeyIsRevokedFieldDocString,
		),
	}

	accountKeyType.Members = MembersAsMap(members)
	accountKeyType.Fields = MembersFieldNames(members)
	return accountKeyType
}()

AccountKeyType represents the key associated with an account.

View Source
var AccountKeyTypeAnnotation = NewTypeAnnotation(AccountKeyType)
View Source
var AccountReferenceType = &ReferenceType{
	Authorization: UnauthorizedAccess,
	Type:          AccountType,
}
View Source
var AccountReferenceTypeAnnotation = NewTypeAnnotation(AccountReferenceType)
View Source
var AccountTypeAddressFieldType = TheAddressType
View Source
var AccountTypeAnnotation = NewTypeAnnotation(AccountType)
View Source
var AccountTypeAvailableBalanceFieldType = UFix64Type
View Source
var AccountTypeBalanceFieldType = UFix64Type
View Source
var AccountTypeCapabilitiesFieldType = Account_CapabilitiesType
View Source
var AccountTypeContractsFieldType = Account_ContractsType
View Source
var AccountTypeInboxFieldType = Account_InboxType
View Source
var AccountTypeKeysFieldType = Account_KeysType
View Source
var AccountTypeStorageFieldType = Account_StorageType
View Source
var Account_AccountCapabilitiesType = func() *CompositeType {
	var t = &CompositeType{
		Identifier:         Account_AccountCapabilitiesTypeName,
		Kind:               common.CompositeKindStructure,
		ImportableBuiltin:  false,
		HasComputedMembers: true,
	}

	return t
}()
View Source
var Account_AccountCapabilitiesTypeForEachControllerFunctionType = &FunctionType{
	Parameters: []Parameter{
		{
			Label:      ArgumentLabelNotRequired,
			Identifier: "function",
			TypeAnnotation: NewTypeAnnotation(&FunctionType{
				Parameters: []Parameter{
					{
						TypeAnnotation: NewTypeAnnotation(&ReferenceType{
							Type:          AccountCapabilityControllerType,
							Authorization: UnauthorizedAccess,
						}),
					},
				},
				ReturnTypeAnnotation: NewTypeAnnotation(
					BoolType,
				),
			}),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		VoidType,
	),
}
View Source
var Account_AccountCapabilitiesTypeGetControllerFunctionType = &FunctionType{
	Purity: FunctionPurityView,
	Parameters: []Parameter{
		{
			Identifier:     "byCapabilityID",
			TypeAnnotation: NewTypeAnnotation(UInt64Type),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		&OptionalType{
			Type: &ReferenceType{
				Type:          AccountCapabilityControllerType,
				Authorization: UnauthorizedAccess,
			},
		},
	),
}
View Source
var Account_AccountCapabilitiesTypeGetControllersFunctionType = &FunctionType{
	Purity: FunctionPurityView,
	ReturnTypeAnnotation: NewTypeAnnotation(
		&VariableSizedType{
			Type: &ReferenceType{
				Type:          AccountCapabilityControllerType,
				Authorization: UnauthorizedAccess,
			},
		},
	),
}
View Source
var Account_AccountCapabilitiesTypeIssueFunctionType = &FunctionType{
	TypeParameters: []*TypeParameter{
		Account_AccountCapabilitiesTypeIssueFunctionTypeParameterT,
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		MustInstantiate(
			&CapabilityType{},
			&GenericType{
				TypeParameter: Account_AccountCapabilitiesTypeIssueFunctionTypeParameterT,
			},
		),
	),
}
View Source
var Account_AccountCapabilitiesTypeIssueFunctionTypeParameterT = &TypeParameter{
	Name: "T",
	TypeBound: &ReferenceType{
		Type:          AccountType,
		Authorization: UnauthorizedAccess,
	},
}
View Source
var Account_AccountCapabilitiesTypeIssueWithTypeFunctionType = &FunctionType{
	Parameters: []Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "type",
			TypeAnnotation: NewTypeAnnotation(MetaType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		&CapabilityType{},
	),
}
View Source
var Account_CapabilitiesType = func() *CompositeType {
	var t = &CompositeType{
		Identifier:         Account_CapabilitiesTypeName,
		Kind:               common.CompositeKindStructure,
		ImportableBuiltin:  false,
		HasComputedMembers: true,
	}

	return t
}()
View Source
var Account_CapabilitiesTypeAccountFieldType = Account_AccountCapabilitiesType
View Source
var Account_CapabilitiesTypeBorrowFunctionType = &FunctionType{
	Purity: FunctionPurityView,
	TypeParameters: []*TypeParameter{
		Account_CapabilitiesTypeBorrowFunctionTypeParameterT,
	},
	Parameters: []Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "path",
			TypeAnnotation: NewTypeAnnotation(PublicPathType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		&OptionalType{
			Type: &GenericType{
				TypeParameter: Account_CapabilitiesTypeBorrowFunctionTypeParameterT,
			},
		},
	),
}
View Source
var Account_CapabilitiesTypeBorrowFunctionTypeParameterT = &TypeParameter{
	Name: "T",
	TypeBound: &ReferenceType{
		Type:          AnyType,
		Authorization: UnauthorizedAccess,
	},
}
View Source
var Account_CapabilitiesTypeExistsFunctionType = &FunctionType{
	Purity: FunctionPurityView,
	Parameters: []Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "path",
			TypeAnnotation: NewTypeAnnotation(PublicPathType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		BoolType,
	),
}
View Source
var Account_CapabilitiesTypeGetFunctionType = &FunctionType{
	Purity: FunctionPurityView,
	TypeParameters: []*TypeParameter{
		Account_CapabilitiesTypeGetFunctionTypeParameterT,
	},
	Parameters: []Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "path",
			TypeAnnotation: NewTypeAnnotation(PublicPathType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		MustInstantiate(
			&CapabilityType{},
			&GenericType{
				TypeParameter: Account_CapabilitiesTypeGetFunctionTypeParameterT,
			},
		),
	),
}
View Source
var Account_CapabilitiesTypeGetFunctionTypeParameterT = &TypeParameter{
	Name: "T",
	TypeBound: &ReferenceType{
		Type:          AnyType,
		Authorization: UnauthorizedAccess,
	},
}
View Source
var Account_CapabilitiesTypePublishFunctionType = &FunctionType{
	Parameters: []Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "capability",
			TypeAnnotation: NewTypeAnnotation(&CapabilityType{}),
		},
		{
			Identifier:     "at",
			TypeAnnotation: NewTypeAnnotation(PublicPathType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		VoidType,
	),
}
View Source
var Account_CapabilitiesTypeStorageFieldType = Account_StorageCapabilitiesType
View Source
var Account_CapabilitiesTypeUnpublishFunctionType = &FunctionType{
	Parameters: []Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "path",
			TypeAnnotation: NewTypeAnnotation(PublicPathType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		&OptionalType{
			Type: &CapabilityType{},
		},
	),
}
View Source
var Account_ContractsType = func() *CompositeType {
	var t = &CompositeType{
		Identifier:         Account_ContractsTypeName,
		Kind:               common.CompositeKindStructure,
		ImportableBuiltin:  false,
		HasComputedMembers: true,
	}

	return t
}()
View Source
var Account_ContractsTypeAddFunctionType = &FunctionType{
	Parameters: []Parameter{
		{
			Identifier:     "name",
			TypeAnnotation: NewTypeAnnotation(StringType),
		},
		{
			Identifier: "code",
			TypeAnnotation: NewTypeAnnotation(&VariableSizedType{
				Type: UInt8Type,
			}),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		DeployedContractType,
	),
}
View Source
var Account_ContractsTypeBorrowFunctionType = &FunctionType{
	Purity: FunctionPurityView,
	TypeParameters: []*TypeParameter{
		Account_ContractsTypeBorrowFunctionTypeParameterT,
	},
	Parameters: []Parameter{
		{
			Identifier:     "name",
			TypeAnnotation: NewTypeAnnotation(StringType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		&OptionalType{
			Type: &GenericType{
				TypeParameter: Account_ContractsTypeBorrowFunctionTypeParameterT,
			},
		},
	),
}
View Source
var Account_ContractsTypeBorrowFunctionTypeParameterT = &TypeParameter{
	Name: "T",
	TypeBound: &ReferenceType{
		Type:          AnyType,
		Authorization: UnauthorizedAccess,
	},
}
View Source
var Account_ContractsTypeGetFunctionType = &FunctionType{
	Purity: FunctionPurityView,
	Parameters: []Parameter{
		{
			Identifier:     "name",
			TypeAnnotation: NewTypeAnnotation(StringType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		&OptionalType{
			Type: DeployedContractType,
		},
	),
}
View Source
var Account_ContractsTypeNamesFieldType = &VariableSizedType{
	Type: StringType,
}
View Source
var Account_ContractsTypeRemoveFunctionType = &FunctionType{
	Parameters: []Parameter{
		{
			Identifier:     "name",
			TypeAnnotation: NewTypeAnnotation(StringType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		&OptionalType{
			Type: DeployedContractType,
		},
	),
}
View Source
var Account_ContractsTypeTryUpdateFunctionType = &FunctionType{
	Parameters: []Parameter{
		{
			Identifier:     "name",
			TypeAnnotation: NewTypeAnnotation(StringType),
		},
		{
			Identifier: "code",
			TypeAnnotation: NewTypeAnnotation(&VariableSizedType{
				Type: UInt8Type,
			}),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		DeploymentResultType,
	),
}
View Source
var Account_ContractsTypeUpdateFunctionType = &FunctionType{
	Parameters: []Parameter{
		{
			Identifier:     "name",
			TypeAnnotation: NewTypeAnnotation(StringType),
		},
		{
			Identifier: "code",
			TypeAnnotation: NewTypeAnnotation(&VariableSizedType{
				Type: UInt8Type,
			}),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		DeployedContractType,
	),
}
View Source
var Account_InboxType = func() *CompositeType {
	var t = &CompositeType{
		Identifier:         Account_InboxTypeName,
		Kind:               common.CompositeKindStructure,
		ImportableBuiltin:  false,
		HasComputedMembers: true,
	}

	return t
}()
View Source
var Account_InboxTypeClaimFunctionType = &FunctionType{
	TypeParameters: []*TypeParameter{
		Account_InboxTypeClaimFunctionTypeParameterT,
	},
	Parameters: []Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "name",
			TypeAnnotation: NewTypeAnnotation(StringType),
		},
		{
			Identifier:     "provider",
			TypeAnnotation: NewTypeAnnotation(TheAddressType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		&OptionalType{
			Type: MustInstantiate(
				&CapabilityType{},
				&GenericType{
					TypeParameter: Account_InboxTypeClaimFunctionTypeParameterT,
				},
			),
		},
	),
}
View Source
var Account_InboxTypeClaimFunctionTypeParameterT = &TypeParameter{
	Name: "T",
	TypeBound: &ReferenceType{
		Type:          AnyType,
		Authorization: UnauthorizedAccess,
	},
}
View Source
var Account_InboxTypePublishFunctionType = &FunctionType{
	Parameters: []Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "value",
			TypeAnnotation: NewTypeAnnotation(&CapabilityType{}),
		},
		{
			Identifier:     "name",
			TypeAnnotation: NewTypeAnnotation(StringType),
		},
		{
			Identifier:     "recipient",
			TypeAnnotation: NewTypeAnnotation(TheAddressType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		VoidType,
	),
}
View Source
var Account_InboxTypeUnpublishFunctionType = &FunctionType{
	TypeParameters: []*TypeParameter{
		Account_InboxTypeUnpublishFunctionTypeParameterT,
	},
	Parameters: []Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "name",
			TypeAnnotation: NewTypeAnnotation(StringType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		&OptionalType{
			Type: MustInstantiate(
				&CapabilityType{},
				&GenericType{
					TypeParameter: Account_InboxTypeUnpublishFunctionTypeParameterT,
				},
			),
		},
	),
}
View Source
var Account_InboxTypeUnpublishFunctionTypeParameterT = &TypeParameter{
	Name: "T",
	TypeBound: &ReferenceType{
		Type:          AnyType,
		Authorization: UnauthorizedAccess,
	},
}
View Source
var Account_KeysType = func() *CompositeType {
	var t = &CompositeType{
		Identifier:         Account_KeysTypeName,
		Kind:               common.CompositeKindStructure,
		ImportableBuiltin:  false,
		HasComputedMembers: true,
	}

	return t
}()
View Source
var Account_KeysTypeAddFunctionType = &FunctionType{
	Parameters: []Parameter{
		{
			Identifier:     "publicKey",
			TypeAnnotation: NewTypeAnnotation(PublicKeyType),
		},
		{
			Identifier:     "hashAlgorithm",
			TypeAnnotation: NewTypeAnnotation(HashAlgorithmType),
		},
		{
			Identifier:     "weight",
			TypeAnnotation: NewTypeAnnotation(UFix64Type),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		AccountKeyType,
	),
}
View Source
var Account_KeysTypeCountFieldType = UInt64Type
View Source
var Account_KeysTypeForEachFunctionType = &FunctionType{
	Parameters: []Parameter{
		{
			Label:      ArgumentLabelNotRequired,
			Identifier: "function",
			TypeAnnotation: NewTypeAnnotation(&FunctionType{
				Parameters: []Parameter{
					{
						TypeAnnotation: NewTypeAnnotation(AccountKeyType),
					},
				},
				ReturnTypeAnnotation: NewTypeAnnotation(
					BoolType,
				),
			}),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		VoidType,
	),
}
View Source
var Account_KeysTypeGetFunctionType = &FunctionType{
	Purity: FunctionPurityView,
	Parameters: []Parameter{
		{
			Identifier:     "keyIndex",
			TypeAnnotation: NewTypeAnnotation(IntType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		&OptionalType{
			Type: AccountKeyType,
		},
	),
}
View Source
var Account_KeysTypeRevokeFunctionType = &FunctionType{
	Parameters: []Parameter{
		{
			Identifier:     "keyIndex",
			TypeAnnotation: NewTypeAnnotation(IntType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		&OptionalType{
			Type: AccountKeyType,
		},
	),
}
View Source
var Account_StorageCapabilitiesType = func() *CompositeType {
	var t = &CompositeType{
		Identifier:         Account_StorageCapabilitiesTypeName,
		Kind:               common.CompositeKindStructure,
		ImportableBuiltin:  false,
		HasComputedMembers: true,
	}

	return t
}()
View Source
var Account_StorageCapabilitiesTypeForEachControllerFunctionType = &FunctionType{
	Parameters: []Parameter{
		{
			Identifier:     "forPath",
			TypeAnnotation: NewTypeAnnotation(StoragePathType),
		},
		{
			Label:      ArgumentLabelNotRequired,
			Identifier: "function",
			TypeAnnotation: NewTypeAnnotation(&FunctionType{
				Parameters: []Parameter{
					{
						TypeAnnotation: NewTypeAnnotation(&ReferenceType{
							Type:          StorageCapabilityControllerType,
							Authorization: UnauthorizedAccess,
						}),
					},
				},
				ReturnTypeAnnotation: NewTypeAnnotation(
					BoolType,
				),
			}),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		VoidType,
	),
}
View Source
var Account_StorageCapabilitiesTypeGetControllerFunctionType = &FunctionType{
	Purity: FunctionPurityView,
	Parameters: []Parameter{
		{
			Identifier:     "byCapabilityID",
			TypeAnnotation: NewTypeAnnotation(UInt64Type),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		&OptionalType{
			Type: &ReferenceType{
				Type:          StorageCapabilityControllerType,
				Authorization: UnauthorizedAccess,
			},
		},
	),
}
View Source
var Account_StorageCapabilitiesTypeGetControllersFunctionType = &FunctionType{
	Purity: FunctionPurityView,
	Parameters: []Parameter{
		{
			Identifier:     "forPath",
			TypeAnnotation: NewTypeAnnotation(StoragePathType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		&VariableSizedType{
			Type: &ReferenceType{
				Type:          StorageCapabilityControllerType,
				Authorization: UnauthorizedAccess,
			},
		},
	),
}
View Source
var Account_StorageCapabilitiesTypeIssueFunctionType = &FunctionType{
	TypeParameters: []*TypeParameter{
		Account_StorageCapabilitiesTypeIssueFunctionTypeParameterT,
	},
	Parameters: []Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "path",
			TypeAnnotation: NewTypeAnnotation(StoragePathType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		MustInstantiate(
			&CapabilityType{},
			&GenericType{
				TypeParameter: Account_StorageCapabilitiesTypeIssueFunctionTypeParameterT,
			},
		),
	),
}
View Source
var Account_StorageCapabilitiesTypeIssueFunctionTypeParameterT = &TypeParameter{
	Name: "T",
	TypeBound: &ReferenceType{
		Type:          AnyType,
		Authorization: UnauthorizedAccess,
	},
}
View Source
var Account_StorageCapabilitiesTypeIssueWithTypeFunctionType = &FunctionType{
	Parameters: []Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "path",
			TypeAnnotation: NewTypeAnnotation(StoragePathType),
		},
		{
			Identifier:     "type",
			TypeAnnotation: NewTypeAnnotation(MetaType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		&CapabilityType{},
	),
}
View Source
var Account_StorageType = func() *CompositeType {
	var t = &CompositeType{
		Identifier:         Account_StorageTypeName,
		Kind:               common.CompositeKindStructure,
		ImportableBuiltin:  false,
		HasComputedMembers: true,
	}

	return t
}()
View Source
var Account_StorageTypeBorrowFunctionType = &FunctionType{
	Purity: FunctionPurityView,
	TypeParameters: []*TypeParameter{
		Account_StorageTypeBorrowFunctionTypeParameterT,
	},
	Parameters: []Parameter{
		{
			Identifier:     "from",
			TypeAnnotation: NewTypeAnnotation(StoragePathType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		&OptionalType{
			Type: &GenericType{
				TypeParameter: Account_StorageTypeBorrowFunctionTypeParameterT,
			},
		},
	),
}
View Source
var Account_StorageTypeBorrowFunctionTypeParameterT = &TypeParameter{
	Name: "T",
	TypeBound: &ReferenceType{
		Type:          AnyType,
		Authorization: UnauthorizedAccess,
	},
}
View Source
var Account_StorageTypeCapacityFieldType = UInt64Type
View Source
var Account_StorageTypeCheckFunctionType = &FunctionType{
	Purity: FunctionPurityView,
	TypeParameters: []*TypeParameter{
		Account_StorageTypeCheckFunctionTypeParameterT,
	},
	Parameters: []Parameter{
		{
			Identifier:     "from",
			TypeAnnotation: NewTypeAnnotation(StoragePathType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		BoolType,
	),
}
View Source
var Account_StorageTypeCheckFunctionTypeParameterT = &TypeParameter{
	Name:      "T",
	TypeBound: AnyType,
}
View Source
var Account_StorageTypeCopyFunctionType = &FunctionType{
	Purity: FunctionPurityView,
	TypeParameters: []*TypeParameter{
		Account_StorageTypeCopyFunctionTypeParameterT,
	},
	Parameters: []Parameter{
		{
			Identifier:     "from",
			TypeAnnotation: NewTypeAnnotation(StoragePathType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		&OptionalType{
			Type: &GenericType{
				TypeParameter: Account_StorageTypeCopyFunctionTypeParameterT,
			},
		},
	),
}
View Source
var Account_StorageTypeCopyFunctionTypeParameterT = &TypeParameter{
	Name:      "T",
	TypeBound: AnyStructType,
}
View Source
var Account_StorageTypeForEachPublicFunctionType = &FunctionType{
	Parameters: []Parameter{
		{
			Label:      ArgumentLabelNotRequired,
			Identifier: "function",
			TypeAnnotation: NewTypeAnnotation(&FunctionType{
				Parameters: []Parameter{
					{
						TypeAnnotation: NewTypeAnnotation(PublicPathType),
					},
					{
						TypeAnnotation: NewTypeAnnotation(MetaType),
					},
				},
				ReturnTypeAnnotation: NewTypeAnnotation(
					BoolType,
				),
			}),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		VoidType,
	),
}
View Source
var Account_StorageTypeForEachStoredFunctionType = &FunctionType{
	Parameters: []Parameter{
		{
			Label:      ArgumentLabelNotRequired,
			Identifier: "function",
			TypeAnnotation: NewTypeAnnotation(&FunctionType{
				Parameters: []Parameter{
					{
						TypeAnnotation: NewTypeAnnotation(StoragePathType),
					},
					{
						TypeAnnotation: NewTypeAnnotation(MetaType),
					},
				},
				ReturnTypeAnnotation: NewTypeAnnotation(
					BoolType,
				),
			}),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		VoidType,
	),
}
View Source
var Account_StorageTypeLoadFunctionType = &FunctionType{
	TypeParameters: []*TypeParameter{
		Account_StorageTypeLoadFunctionTypeParameterT,
	},
	Parameters: []Parameter{
		{
			Identifier:     "from",
			TypeAnnotation: NewTypeAnnotation(StoragePathType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		&OptionalType{
			Type: &GenericType{
				TypeParameter: Account_StorageTypeLoadFunctionTypeParameterT,
			},
		},
	),
}
View Source
var Account_StorageTypeLoadFunctionTypeParameterT = &TypeParameter{
	Name:      "T",
	TypeBound: StorableType,
}
View Source
var Account_StorageTypePublicPathsFieldType = &VariableSizedType{
	Type: PublicPathType,
}
View Source
var Account_StorageTypeSaveFunctionType = &FunctionType{
	TypeParameters: []*TypeParameter{
		Account_StorageTypeSaveFunctionTypeParameterT,
	},
	Parameters: []Parameter{
		{
			Label:      ArgumentLabelNotRequired,
			Identifier: "value",
			TypeAnnotation: NewTypeAnnotation(&GenericType{
				TypeParameter: Account_StorageTypeSaveFunctionTypeParameterT,
			}),
		},
		{
			Identifier:     "to",
			TypeAnnotation: NewTypeAnnotation(StoragePathType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		VoidType,
	),
}
View Source
var Account_StorageTypeSaveFunctionTypeParameterT = &TypeParameter{
	Name:      "T",
	TypeBound: StorableType,
}
View Source
var Account_StorageTypeStoragePathsFieldType = &VariableSizedType{
	Type: StoragePathType,
}
View Source
var Account_StorageTypeTypeFunctionType = &FunctionType{
	Purity: FunctionPurityView,
	Parameters: []Parameter{
		{
			Label:          "at",
			Identifier:     "path",
			TypeAnnotation: NewTypeAnnotation(StoragePathType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		&OptionalType{
			Type: MetaType,
		},
	),
}
View Source
var Account_StorageTypeUsedFieldType = UInt64Type
View Source
var AddContractType = &EntitlementType{
	Identifier: "AddContract",
}
View Source
var AddKeyType = &EntitlementType{
	Identifier: "AddKey",
}
View Source
var AddressConversionFunctionType = &FunctionType{
	Purity: FunctionPurityView,
	Parameters: []Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "value",
			TypeAnnotation: IntegerTypeAnnotation,
		},
	},
	ReturnTypeAnnotation: AddressTypeAnnotation,
	ArgumentExpressionsCheck: func(checker *Checker, argumentExpressions []ast.Expression, _ ast.HasPosition) {
		if len(argumentExpressions) < 1 {
			return
		}

		intExpression, ok := argumentExpressions[0].(*ast.IntegerExpression)
		if !ok {
			return
		}

		CheckAddressLiteral(nil, intExpression, checker.report)
	},
}
View Source
var AddressTypeAnnotation = NewTypeAnnotation(TheAddressType)
View Source
var AddressTypeFromBytesFunctionType = &FunctionType{
	Purity: FunctionPurityView,
	Parameters: []Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "bytes",
			TypeAnnotation: NewTypeAnnotation(ByteArrayType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(TheAddressType),
}
View Source
var AddressTypeFromStringFunctionType = FromStringFunctionType(TheAddressType)
View Source
var AddressTypeMaxIntBig = new(big.Int).SetUint64(math.MaxUint64)
View Source
var AddressTypeMinIntBig = new(big.Int)
View Source
var AllSignedFixedPointTypes = []Type{
	Fix64Type,
}
View Source
var AllUnsignedFixedPointTypes = []Type{
	UFix64Type,
}
View Source
var AllUnsignedIntegerTypes = common.Concat(
	AllFixedSizeUnsignedIntegerTypes,
	[]Type{
		UIntType,
	},
)
View Source
var AnyResourceAttachmentType = &SimpleType{
	Name:          AnyResourceAttachmentTypeName,
	QualifiedName: AnyResourceAttachmentTypeName,
	TypeID:        AnyResourceAttachmentTypeName,
	TypeTag:       AnyResourceAttachmentTypeTag,
	IsResource:    true,
	Primitive:     false,

	Storable:   true,
	Equatable:  false,
	Comparable: false,

	Exportable: true,
	Importable: false,
}

AnyResourceAttachmentType represents the top type of all resource attachment types

View Source
var AnyResourceType = &SimpleType{
	Name:          "AnyResource",
	QualifiedName: "AnyResource",
	TypeID:        "AnyResource",
	TypeTag:       AnyResourceTypeTag,
	IsResource:    true,
	Primitive:     false,

	Storable:   true,
	Equatable:  false,
	Comparable: false,

	Exportable:    true,
	Importable:    false,
	ContainFields: true,
}

AnyResourceType represents the top type of all resource types

View Source
var AnyStructAttachmentType = &SimpleType{
	Name:          AnyStructAttachmentTypeName,
	QualifiedName: AnyStructAttachmentTypeName,
	TypeID:        AnyStructAttachmentTypeName,
	TypeTag:       AnyStructAttachmentTypeTag,
	IsResource:    false,
	Primitive:     false,

	Storable:   true,
	Equatable:  false,
	Comparable: false,

	Exportable: true,
	Importable: false,
}

AnyStructAttachmentType represents the top type of all struct attachment types

View Source
var AnyStructType = &SimpleType{
	Name:          "AnyStruct",
	QualifiedName: "AnyStruct",
	TypeID:        "AnyStruct",
	TypeTag:       AnyStructTypeTag,
	IsResource:    false,

	Storable:   true,
	Primitive:  false,
	Equatable:  false,
	Comparable: false,
	Exportable: true,

	Importable:    true,
	ContainFields: true,
}

AnyStructType represents the top type of all non-resource types

View Source
var AnyStructTypeAnnotation = NewTypeAnnotation(AnyStructType)
View Source
var AnyType = &SimpleType{
	Name:          "Any",
	QualifiedName: "Any",
	TypeID:        "Any",
	TypeTag:       AnyTypeTag,
	IsResource:    false,

	Storable:   true,
	Primitive:  false,
	Equatable:  false,
	Comparable: false,

	Exportable: false,
	Importable: false,
}

AnyType represents the top type of all types. NOTE: This type is only used internally and is not available in programs.

View Source
var BaseTypeActivation = NewVariableActivation(nil)

BaseTypeActivation is the base activation that contains the types available in programs

View Source
var BaseValueActivation = NewVariableActivation(nil)

BaseValueActivation is the base activation that contains the values available in programs

View Source
var BlockType = &SimpleType{
	Name:          BlockTypeName,
	QualifiedName: BlockTypeName,
	TypeID:        BlockTypeName,
	TypeTag:       BlockTypeTag,
	IsResource:    false,
	Storable:      false,
	Primitive:     false,
	Equatable:     false,
	Comparable:    false,
	Exportable:    false,
	Importable:    false,
	ContainFields: true,
}
View Source
var BlockTypeAnnotation = NewTypeAnnotation(BlockType)
View Source
var BlockTypeHeightFieldType = UInt64Type
View Source
var BlockTypeIdFieldType = &ConstantSizedType{
	Type: UInt8Type,
	Size: 32,
}
View Source
var BlockTypeTimestampFieldType = UFix64Type
View Source
var BlockTypeViewFieldType = UInt64Type
View Source
var BoolType = &SimpleType{
	Name:          "Bool",
	QualifiedName: "Bool",
	TypeID:        "Bool",
	TypeTag:       BoolTypeTag,
	IsResource:    false,
	Storable:      true,
	Primitive:     true,
	Equatable:     true,
	Comparable:    true,
	Exportable:    true,
	Importable:    true,
}

BoolType represents the boolean type

View Source
var BoolTypeAnnotation = NewTypeAnnotation(BoolType)
View Source
var BorrowValueType = &EntitlementType{
	Identifier: "BorrowValue",
}
View Source
var BuiltinEntitlementMappings = map[string]*EntitlementMapType{
	IdentityType.QualifiedIdentifier(): IdentityType,
}
View Source
var BuiltinEntitlements = map[string]*EntitlementType{}
View Source
var ByteArrayArrayType = &VariableSizedType{
	Type: ByteArrayType,
}

ByteArrayArrayType represents the type [[UInt8]]

View Source
var ByteArrayArrayTypeAnnotation = NewTypeAnnotation(ByteArrayArrayType)
View Source
var ByteArrayType = &VariableSizedType{
	Type: UInt8Type,
}

ByteArrayType represents the type [UInt8]

View Source
var ByteArrayTypeAnnotation = NewTypeAnnotation(ByteArrayType)
View Source
var CapabilitiesType = &EntitlementType{
	Identifier: "Capabilities",
}
View Source
var CapabilityPathType = &SimpleType{
	Name:          "CapabilityPath",
	QualifiedName: "CapabilityPath",
	TypeID:        "CapabilityPath",
	TypeTag:       CapabilityPathTypeTag,
	IsResource:    false,
	Storable:      true,
	Primitive:     true,
	Equatable:     true,
	Comparable:    false,
	Exportable:    true,
	Importable:    true,
}

CapabilityPathType

View Source
var CapabilityPathTypeAnnotation = NewTypeAnnotation(CapabilityPathType)
View Source
var CapabilityTypeAddressFieldType = TheAddressType
View Source
var CapabilityTypeFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "type",
			TypeAnnotation: MetaTypeAnnotation,
		},
	},
	OptionalMetaTypeAnnotation,
)
View Source
var CapabilityTypeIDFieldType = UInt64Type
View Source
var CharacterType = &SimpleType{
	Name:          CharacterTypeName,
	QualifiedName: CharacterTypeName,
	TypeID:        CharacterTypeName,
	TypeTag:       CharacterTypeTag,
	IsResource:    false,
	Storable:      true,
	Primitive:     true,
	Equatable:     true,
	Comparable:    true,
	Exportable:    true,
	Importable:    true,
	ContainFields: false,
}
View Source
var CharacterTypeToStringFunctionType = &FunctionType{
	Purity: FunctionPurityView,
	ReturnTypeAnnotation: NewTypeAnnotation(
		StringType,
	),
}
View Source
var CharacterTypeUtf8FieldType = &VariableSizedType{
	Type: UInt8Type,
}
View Source
var ClaimInboxCapabilityType = &EntitlementType{
	Identifier: "ClaimInboxCapability",
}
View Source
var CompositeTypeFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "identifier",
			TypeAnnotation: StringTypeAnnotation,
		},
	},
	OptionalMetaTypeAnnotation,
)
View Source
var ConstantSizedArrayTypeFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Identifier:     "type",
			TypeAnnotation: MetaTypeAnnotation,
		},
		{
			Identifier:     "size",
			TypeAnnotation: IntTypeAnnotation,
		},
	},
	MetaTypeAnnotation,
)
View Source
var ContractAccountFieldType = &ReferenceType{
	Type:          AccountType,
	Authorization: FullyEntitledAccountAccess,
}
View Source
var ContractsType = &EntitlementType{
	Identifier: "Contracts",
}
View Source
var CopyValueType = &EntitlementType{
	Identifier: "CopyValue",
}
View Source
var DeployedContractType = &SimpleType{
	Name:          DeployedContractTypeName,
	QualifiedName: DeployedContractTypeName,
	TypeID:        DeployedContractTypeName,
	TypeTag:       DeployedContractTypeTag,
	IsResource:    false,
	Storable:      false,
	Primitive:     false,
	Equatable:     false,
	Comparable:    false,
	Exportable:    false,
	Importable:    false,
	ContainFields: true,
}
View Source
var DeployedContractTypeAddressFieldType = TheAddressType
View Source
var DeployedContractTypeCodeFieldType = &VariableSizedType{
	Type: UInt8Type,
}
View Source
var DeployedContractTypeNameFieldType = StringType
View Source
var DeployedContractTypePublicTypesFunctionType = &FunctionType{
	Purity: FunctionPurityView,
	ReturnTypeAnnotation: NewTypeAnnotation(
		&VariableSizedType{
			Type: MetaType,
		},
	),
}
View Source
var DeploymentResultType = func() *CompositeType {
	var t = &CompositeType{
		Identifier:         DeploymentResultTypeName,
		Kind:               common.CompositeKindStructure,
		ImportableBuiltin:  false,
		HasComputedMembers: true,
	}

	return t
}()
View Source
var DeploymentResultTypeDeployedContractFieldType = &OptionalType{
	Type: DeployedContractType,
}
View Source
var DictionaryTypeFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Identifier:     "key",
			TypeAnnotation: MetaTypeAnnotation,
		},
		{
			Identifier:     "value",
			TypeAnnotation: MetaTypeAnnotation,
		},
	},
	OptionalMetaTypeAnnotation,
)

FullyEntitledAccountAccess represents

auth(Storage, Contracts, Keys, Inbox, Capabilities)
View Source
var FullyEntitledAccountReferenceType = &ReferenceType{
	Authorization: FullyEntitledAccountAccess,
	Type:          AccountType,
}

FullyEntitledAccountReferenceType represents the type

auth(Storage, Contracts, Keys, Inbox, Capabilities) &Account
View Source
var FullyEntitledAccountReferenceTypeAnnotation = NewTypeAnnotation(FullyEntitledAccountReferenceType)
View Source
var FunctionTypeFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Identifier: "parameters",
			TypeAnnotation: NewTypeAnnotation(
				&VariableSizedType{
					Type: MetaType,
				},
			),
		},
		{
			Identifier:     "return",
			TypeAnnotation: MetaTypeAnnotation,
		},
	},
	MetaTypeAnnotation,
)
View Source
var GetAccountCapabilityControllerType = &EntitlementType{
	Identifier: "GetAccountCapabilityController",
}
View Source
var GetStorageCapabilityControllerType = &EntitlementType{
	Identifier: "GetStorageCapabilityController",
}
View Source
var HashAlgorithmTypeAnnotation = NewTypeAnnotation(HashAlgorithmType)
View Source
var HashAlgorithmTypeHashFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "data",
			TypeAnnotation: ByteArrayTypeAnnotation,
		},
	},
	ByteArrayTypeAnnotation,
)
View Source
var HashAlgorithmTypeHashWithTagFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "data",
			TypeAnnotation: ByteArrayTypeAnnotation,
		},
		{
			Identifier:     "tag",
			TypeAnnotation: StringTypeAnnotation,
		},
	},
	ByteArrayTypeAnnotation,
)
View Source
var HashableStructType = &SimpleType{
	Name:          HashableStructTypeName,
	QualifiedName: HashableStructTypeName,
	TypeID:        HashableStructTypeName,
	TypeTag:       HashableStructTypeTag,
	IsResource:    false,
	Storable:      true,
	Primitive:     false,
	Equatable:     false,
	Comparable:    false,
	Exportable:    true,
	Importable:    true,
	ContainFields: false,
}
View Source
var IdentityType = func() *EntitlementMapType {
	m := NewEntitlementMapType(nil, nil, IdentityMappingIdentifier)
	m.IncludesIdentity = true
	m.resolveInclusions.Do(func() {})
	return m
}()

IdentityType represents the `Identity` entitlement mapping type. It is an empty map that includes the Identity map, and is considered already "resolved" with regards to its (vacuously empty) inclusions. defining it this way eliminates the need to do any special casing for its behavior

View Source
var InboxType = &EntitlementType{
	Identifier: "Inbox",
}
View Source
var InclusiveRangeTypeFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "type",
			TypeAnnotation: MetaTypeAnnotation,
		},
	},
	OptionalMetaTypeAnnotation,
)
View Source
var InsertType = &EntitlementType{
	Identifier: "Insert",
}
View Source
var IntersectionTypeFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Identifier: "types",
			TypeAnnotation: NewTypeAnnotation(
				&VariableSizedType{
					Type: StringType,
				},
			),
		},
	},
	OptionalMetaTypeAnnotation,
)
View Source
var InvalidType = &SimpleType{
	Name:          "<<invalid>>",
	QualifiedName: "<<invalid>>",
	TypeID:        "<<invalid>>",
	TypeTag:       InvalidTypeTag,
	IsResource:    false,
	Storable:      false,
	Primitive:     false,
	Equatable:     false,
	Comparable:    false,
	Exportable:    false,
	Importable:    false,
}

InvalidType represents a type that is invalid. It is the result of type checking failing and can't be expressed in programs.

View Source
var IssueAccountCapabilityControllerType = &EntitlementType{
	Identifier: "IssueAccountCapabilityController",
}
View Source
var IssueStorageCapabilityControllerType = &EntitlementType{
	Identifier: "IssueStorageCapabilityController",
}
View Source
var KeysType = &EntitlementType{
	Identifier: "Keys",
}
View Source
var LoadValueType = &EntitlementType{
	Identifier: "LoadValue",
}
View Source
var MetaType = &SimpleType{
	Name:          MetaTypeName,
	QualifiedName: MetaTypeName,
	TypeID:        MetaTypeName,
	TypeTag:       MetaTypeTag,
	IsResource:    false,
	Storable:      true,
	Primitive:     false,
	Equatable:     true,
	Comparable:    false,
	Exportable:    true,
	Importable:    true,
}

MetaType represents the type of a type.

View Source
var MetaTypeAnnotation = NewTypeAnnotation(MetaType)
View Source
var MetaTypeIsSubtypeFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Label:          "of",
			Identifier:     "otherType",
			TypeAnnotation: MetaTypeAnnotation,
		},
	},
	BoolTypeAnnotation,
)
View Source
var MutateType = &EntitlementType{
	Identifier: "Mutate",
}
View Source
var NativeCompositeTypes = map[string]*CompositeType{}
View Source
var NeverType = &SimpleType{
	Name:          "Never",
	QualifiedName: "Never",
	TypeID:        "Never",
	TypeTag:       NeverTypeTag,
	IsResource:    false,
	Storable:      false,
	Primitive:     false,
	Equatable:     false,
	Comparable:    false,
	Exportable:    false,
	Importable:    false,
}

NeverType represents the bottom type

View Source
var NeverTypeAnnotation = NewTypeAnnotation(NeverType)
View Source
var NilType = &OptionalType{
	Type: NeverType,
}
View Source
var OptionalMetaTypeAnnotation = NewTypeAnnotation(&OptionalType{
	Type: MetaType,
})
View Source
var OptionalTypeFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "type",
			TypeAnnotation: MetaTypeAnnotation,
		},
	},
	MetaTypeAnnotation,
)
View Source
var PathType = &SimpleType{
	Name:          "Path",
	QualifiedName: "Path",
	TypeID:        "Path",
	TypeTag:       PathTypeTag,
	IsResource:    false,
	Storable:      true,
	Primitive:     true,
	Equatable:     true,
	Comparable:    false,
	Exportable:    true,
	Importable:    true,
}

PathType

View Source
var PathTypeAnnotation = NewTypeAnnotation(PathType)
View Source
var PrivatePathConversionFunctionType = pathConversionFunctionType(PrivatePathType)
View Source
var PrivatePathType = &SimpleType{
	Name:          "PrivatePath",
	QualifiedName: "PrivatePath",
	TypeID:        "PrivatePath",
	TypeTag:       PrivatePathTypeTag,
	IsResource:    false,
	Storable:      true,
	Primitive:     true,
	Equatable:     true,
	Comparable:    false,
	Exportable:    true,
	Importable:    true,
}

PrivatePathType

View Source
var PrivatePathTypeAnnotation = NewTypeAnnotation(PrivatePathType)
View Source
var PublicKeyArrayType = &VariableSizedType{
	Type: PublicKeyType,
}
View Source
var PublicKeyArrayTypeAnnotation = NewTypeAnnotation(PublicKeyArrayType)
View Source
var PublicKeyType = func() *CompositeType {

	publicKeyType := &CompositeType{
		Identifier:         PublicKeyTypeName,
		Kind:               common.CompositeKindStructure,
		HasComputedMembers: true,
		ImportableBuiltin:  true,
	}

	var members = []*Member{
		NewUnmeteredPublicConstantFieldMember(
			publicKeyType,
			PublicKeyTypePublicKeyFieldName,
			ByteArrayType,
			publicKeyKeyFieldDocString,
		),
		NewUnmeteredPublicConstantFieldMember(
			publicKeyType,
			PublicKeyTypeSignAlgoFieldName,
			SignatureAlgorithmType,
			publicKeySignAlgoFieldDocString,
		),
		NewUnmeteredPublicFunctionMember(
			publicKeyType,
			PublicKeyTypeVerifyFunctionName,
			PublicKeyVerifyFunctionType,
			publicKeyVerifyFunctionDocString,
		),
		NewUnmeteredPublicFunctionMember(
			publicKeyType,
			PublicKeyTypeVerifyPoPFunctionName,
			PublicKeyVerifyPoPFunctionType,
			publicKeyVerifyPoPFunctionDocString,
		),
	}

	publicKeyType.Members = MembersAsMap(members)
	publicKeyType.Fields = MembersFieldNames(members)

	return publicKeyType
}()

PublicKeyType represents the public key associated with an account key.

View Source
var PublicKeyTypeAnnotation = NewTypeAnnotation(PublicKeyType)
View Source
var PublicKeyVerifyFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Identifier:     "signature",
			TypeAnnotation: ByteArrayTypeAnnotation,
		},
		{
			Identifier:     "signedData",
			TypeAnnotation: ByteArrayTypeAnnotation,
		},
		{
			Identifier:     "domainSeparationTag",
			TypeAnnotation: StringTypeAnnotation,
		},
		{
			Identifier:     "hashAlgorithm",
			TypeAnnotation: HashAlgorithmTypeAnnotation,
		},
	},
	BoolTypeAnnotation,
)
View Source
var PublicKeyVerifyPoPFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "proof",
			TypeAnnotation: ByteArrayTypeAnnotation,
		},
	},
	BoolTypeAnnotation,
)
View Source
var PublicPathConversionFunctionType = pathConversionFunctionType(PublicPathType)
View Source
var PublicPathType = &SimpleType{
	Name:          "PublicPath",
	QualifiedName: "PublicPath",
	TypeID:        "PublicPath",
	TypeTag:       PublicPathTypeTag,
	IsResource:    false,
	Storable:      true,
	Primitive:     true,
	Equatable:     true,
	Comparable:    false,
	Exportable:    true,
	Importable:    true,
}

PublicPathType

View Source
var PublicPathTypeAnnotation = NewTypeAnnotation(PublicPathType)
View Source
var PublishCapabilityType = &EntitlementType{
	Identifier: "PublishCapability",
}
View Source
var PublishInboxCapabilityType = &EntitlementType{
	Identifier: "PublishInboxCapability",
}
View Source
var ReferenceTypeFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Identifier: "entitlements",
			TypeAnnotation: NewTypeAnnotation(
				&VariableSizedType{
					Type: StringType,
				},
			),
		},
		{
			Identifier:     "type",
			TypeAnnotation: MetaTypeAnnotation,
		},
	},
	OptionalMetaTypeAnnotation,
)
View Source
var RemoveContractType = &EntitlementType{
	Identifier: "RemoveContract",
}
View Source
var RemoveType = &EntitlementType{
	Identifier: "Remove",
}
View Source
var ResourceOwnerFieldType = &OptionalType{
	Type: AccountReferenceType,
}
View Source
var ResourceUUIDFieldType = UInt64Type
View Source
var RevokeKeyType = &EntitlementType{
	Identifier: "RevokeKey",
}
View Source
var SaturatingArithmeticTypeFunctionTypes = map[Type]*FunctionType{}
View Source
var SaveValueType = &EntitlementType{
	Identifier: "SaveValue",
}
View Source
var SignatureAlgorithmType = newNativeEnumType(
	SignatureAlgorithmTypeName,
	UInt8Type,
	nil,
)
View Source
var SignatureAlgorithmTypeAnnotation = NewTypeAnnotation(SignatureAlgorithmType)
View Source
var StorableType = &SimpleType{
	Name:          "Storable",
	QualifiedName: "Storable",
	TypeID:        "Storable",

	IsResource: false,
	Storable:   true,
	Primitive:  false,
	Equatable:  false,
	Comparable: false,
	Exportable: false,
	Importable: false,
}

StorableType is the supertype of all types which are storable.

It is only used as e.g. a type bound, but is not accessible to user programs, i.e. can't be used in type annotations for e.g. parameters, return types, fields, etc.

View Source
var StorageCapabilitiesType = &EntitlementType{
	Identifier: "StorageCapabilities",
}
View Source
var StorageCapabilityControllerType = &SimpleType{
	Name:          StorageCapabilityControllerTypeName,
	QualifiedName: StorageCapabilityControllerTypeName,
	TypeID:        StorageCapabilityControllerTypeName,
	TypeTag:       StorageCapabilityControllerTypeTag,
	IsResource:    false,
	Storable:      false,
	Primitive:     false,
	Equatable:     false,
	Comparable:    false,
	Exportable:    false,
	Importable:    false,
	ContainFields: true,
}
View Source
var StorageCapabilityControllerTypeAnnotation = NewTypeAnnotation(StorageCapabilityControllerType)
View Source
var StorageCapabilityControllerTypeBorrowTypeFieldType = MetaType
View Source
var StorageCapabilityControllerTypeCapabilityFieldType = &CapabilityType{}
View Source
var StorageCapabilityControllerTypeCapabilityIDFieldType = UInt64Type
View Source
var StorageCapabilityControllerTypeDeleteFunctionType = &FunctionType{
	ReturnTypeAnnotation: NewTypeAnnotation(
		VoidType,
	),
}
View Source
var StorageCapabilityControllerTypeRetargetFunctionType = &FunctionType{
	Parameters: []Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "target",
			TypeAnnotation: NewTypeAnnotation(StoragePathType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		VoidType,
	),
}
View Source
var StorageCapabilityControllerTypeSetTagFunctionType = &FunctionType{
	Parameters: []Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "tag",
			TypeAnnotation: NewTypeAnnotation(StringType),
		},
	},
	ReturnTypeAnnotation: NewTypeAnnotation(
		VoidType,
	),
}
View Source
var StorageCapabilityControllerTypeTagFieldType = StringType
View Source
var StorageCapabilityControllerTypeTargetFunctionType = &FunctionType{
	ReturnTypeAnnotation: NewTypeAnnotation(
		StoragePathType,
	),
}
View Source
var StoragePathConversionFunctionType = pathConversionFunctionType(StoragePathType)
View Source
var StoragePathType = &SimpleType{
	Name:          "StoragePath",
	QualifiedName: "StoragePath",
	TypeID:        "StoragePath",
	TypeTag:       StoragePathTypeTag,
	IsResource:    false,
	Storable:      true,
	Primitive:     true,
	Equatable:     true,
	Comparable:    false,
	Exportable:    true,
	Importable:    true,
}

StoragePathType

View Source
var StoragePathTypeAnnotation = NewTypeAnnotation(StoragePathType)
View Source
var StorageType = &EntitlementType{
	Identifier: "Storage",
}
View Source
var StringFunctionType = func() *FunctionType {

	typeName := StringType.String()

	if BaseValueActivation.Find(typeName) != nil {
		panic(errors.NewUnreachableError())
	}

	functionType := NewSimpleFunctionType(
		FunctionPurityView,
		nil,
		StringTypeAnnotation,
	)

	addMember := func(member *Member) {
		if functionType.Members == nil {
			functionType.Members = &StringMemberOrderedMap{}
		}
		name := member.Identifier.Identifier
		if functionType.Members.Contains(name) {
			panic(errors.NewUnreachableError())
		}
		functionType.Members.Set(name, member)
	}

	addMember(NewUnmeteredPublicFunctionMember(
		functionType,
		StringTypeEncodeHexFunctionName,
		StringTypeEncodeHexFunctionType,
		StringTypeEncodeHexFunctionDocString,
	))

	addMember(NewUnmeteredPublicFunctionMember(
		functionType,
		StringTypeFromUtf8FunctionName,
		StringTypeFromUtf8FunctionType,
		StringTypeFromUtf8FunctionDocString,
	))

	addMember(NewUnmeteredPublicFunctionMember(
		functionType,
		StringTypeFromCharactersFunctionName,
		StringTypeFromCharactersFunctionType,
		StringTypeFromCharactersFunctionDocString,
	))

	addMember(NewUnmeteredPublicFunctionMember(
		functionType,
		StringTypeJoinFunctionName,
		StringTypeJoinFunctionType,
		StringTypeJoinFunctionDocString,
	))

	BaseValueActivation.Set(
		typeName,
		baseFunctionVariable(
			typeName,
			functionType,
			stringFunctionDocString,
		),
	)

	return functionType
}()
View Source
var StringType = &SimpleType{
	Name:          "String",
	QualifiedName: "String",
	TypeID:        "String",
	TypeTag:       StringTypeTag,
	IsResource:    false,
	Storable:      true,
	Primitive:     true,
	Equatable:     true,
	Comparable:    true,
	Exportable:    true,
	Importable:    true,
	ValueIndexingInfo: ValueIndexingInfo{
		IsValueIndexableType:          true,
		AllowsValueIndexingAssignment: false,
		ElementType: func(_ bool) Type {
			return CharacterType
		},
		IndexingType: IntegerType,
	},
}

StringType represents the string type

View Source
var StringTypeAnnotation = NewTypeAnnotation(StringType)
View Source
var StringTypeConcatFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "other",
			TypeAnnotation: StringTypeAnnotation,
		},
	},
	StringTypeAnnotation,
)
View Source
var StringTypeContainsFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "other",
			TypeAnnotation: StringTypeAnnotation,
		},
	},
	BoolTypeAnnotation,
)
View Source
var StringTypeCountFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "other",
			TypeAnnotation: StringTypeAnnotation,
		},
	},
	IntTypeAnnotation,
)
View Source
var StringTypeEncodeHexFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "data",
			TypeAnnotation: ByteArrayTypeAnnotation,
		},
	},
	StringTypeAnnotation,
)
View Source
var StringTypeFromCharactersFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Label:      ArgumentLabelNotRequired,
			Identifier: "characters",
			TypeAnnotation: NewTypeAnnotation(&VariableSizedType{
				Type: CharacterType,
			}),
		},
	},
	StringTypeAnnotation,
)
View Source
var StringTypeFromUtf8FunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "bytes",
			TypeAnnotation: ByteArrayTypeAnnotation,
		},
	},
	NewTypeAnnotation(
		&OptionalType{
			Type: StringType,
		},
	),
)
View Source
var StringTypeIndexFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Label:          "of",
			Identifier:     "other",
			TypeAnnotation: StringTypeAnnotation,
		},
	},
	IntTypeAnnotation,
)
View Source
var StringTypeJoinFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Label:      ArgumentLabelNotRequired,
			Identifier: "strings",
			TypeAnnotation: NewTypeAnnotation(&VariableSizedType{
				Type: StringType,
			}),
		},
		{
			Identifier:     "separator",
			TypeAnnotation: NewTypeAnnotation(StringType),
		},
	},
	StringTypeAnnotation,
)
View Source
var StringTypeReplaceAllFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Label:          "of",
			Identifier:     "old",
			TypeAnnotation: StringTypeAnnotation,
		},
		{
			Label:          "with",
			Identifier:     "replacement",
			TypeAnnotation: StringTypeAnnotation,
		},
	},
	StringTypeAnnotation,
)
View Source
var StringTypeSliceFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Identifier:     "from",
			TypeAnnotation: IntTypeAnnotation,
		},
		{
			Identifier:     "upTo",
			TypeAnnotation: IntTypeAnnotation,
		},
	},
	StringTypeAnnotation,
)
View Source
var StringTypeSplitFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Identifier:     "separator",
			TypeAnnotation: StringTypeAnnotation,
		},
	},
	NewTypeAnnotation(
		&VariableSizedType{
			Type: StringType,
		},
	),
)
View Source
var TheAddressType = &AddressType{}
View Source
var UnpublishCapabilityType = &EntitlementType{
	Identifier: "UnpublishCapability",
}
View Source
var UnpublishInboxCapabilityType = &EntitlementType{
	Identifier: "UnpublishInboxCapability",
}
View Source
var UpdateContractType = &EntitlementType{
	Identifier: "UpdateContract",
}
View Source
var VariableSizedArrayTypeFunctionType = NewSimpleFunctionType(
	FunctionPurityView,
	[]Parameter{
		{
			Label:          ArgumentLabelNotRequired,
			Identifier:     "type",
			TypeAnnotation: MetaTypeAnnotation,
		},
	},
	MetaTypeAnnotation,
)
View Source
var VoidType = &SimpleType{
	Name:          "Void",
	QualifiedName: "Void",
	TypeID:        "Void",
	TypeTag:       VoidTypeTag,
	IsResource:    false,
	Storable:      false,
	Primitive:     true,
	Equatable:     true,
	Comparable:    false,
	Exportable:    true,
	Importable:    false,
}

VoidType represents the void type

View Source
var VoidTypeAnnotation = NewTypeAnnotation(VoidType)

Functions

func AreCompatibleEquatableTypes

func AreCompatibleEquatableTypes(leftType, rightType Type) bool

func CheckAddressLiteral added in v0.12.0

func CheckAddressLiteral(memoryGauge common.MemoryGauge, expression *ast.IntegerExpression, report func(error)) bool

CheckAddressLiteral checks that the value of the integer literal fits into the range of an address (64 bits), and is hexadecimal

func CheckFixedPointLiteral added in v0.12.0

func CheckFixedPointLiteral(
	memoryGauge common.MemoryGauge,
	expression *ast.FixedPointExpression,
	targetType Type,
	report func(error),
) bool

CheckFixedPointLiteral checks that the value of the fixed-point literal fits into range of the target fixed-point type

func CheckIntegerLiteral added in v0.12.0

func CheckIntegerLiteral(memoryGauge common.MemoryGauge, expression *ast.IntegerExpression, targetType Type, report func(error)) bool

CheckIntegerLiteral checks that the value of the integer literal fits into range of the target integer type

func CheckParameterizedTypeInstantiated added in v1.0.0

func CheckParameterizedTypeInstantiated(
	t ParameterizedType,
	pos ast.HasPosition,
	memoryGauge common.MemoryGauge,
	report func(err error),
)

func ErrorMessageExpectedActualTypes added in v0.30.0

func ErrorMessageExpectedActualTypes(
	expectedType Type,
	actualType Type,
) (
	expected string,
	actual string,
)

func FailableCastCanSucceed

func FailableCastCanSucceed(subType, superType Type) bool

FailableCastCanSucceed checks a failable (dynamic) cast, i.e. a cast that might succeed at run-time. It returns true if the cast from subType to superType could potentially succeed at run-time, and returns false if the cast will definitely always fail.

func FormatCapabilityTypeID added in v0.39.0

func FormatCapabilityTypeID[T ~string](borrowTypeID T) T

func FormatConstantSizedTypeID added in v1.0.0

func FormatConstantSizedTypeID[T ~string](elementTypeID T, size int64) T

func FormatDictionaryTypeID added in v1.0.0

func FormatDictionaryTypeID[T ~string](keyTypeID T, valueTypeID T) T

func FormatEntitlementSetTypeID added in v1.0.0

func FormatEntitlementSetTypeID[T ~string](entitlementTypeIDs []T, kind EntitlementSetKind) T

func FormatFunctionTypeID added in v0.39.0

func FormatFunctionTypeID(
	purity string,
	typeParameters []string,
	parameters []string,
	returnTypeAnnotation string,
) string

func FormatIntersectionTypeID added in v1.0.0

func FormatIntersectionTypeID[T ~string](interfaceTypeIDs []T) T

func FormatOptionalTypeID added in v1.0.0

func FormatOptionalTypeID[T ~string](elementTypeID T) T

func FormatReferenceTypeID added in v0.39.0

func FormatReferenceTypeID[T ~string](authorization T, borrowTypeID T) T

func FormatVariableSizedTypeID added in v1.0.0

func FormatVariableSizedTypeID[T ~string](elementTypeID T) T

func FromBigEndianBytesFunctionDocstring added in v0.39.0

func FromBigEndianBytesFunctionDocstring(ty Type) string

func FromStringFunctionDocstring added in v0.28.0

func FromStringFunctionDocstring(ty Type) string

func FunctionEntryPointDeclaration added in v0.11.0

func FunctionEntryPointDeclaration(program *ast.Program) *ast.FunctionDeclaration

FunctionEntryPointDeclaration returns the entry point function declaration, if any.

Returns nil if there are multiple function declarations with the same function entry point name, or a transaction declaration.

func IsHashableStructType added in v1.0.0

func IsHashableStructType(t Type) bool

func IsNilType

func IsNilType(ty Type) bool

IsNilType returns true if the given type is the type of `nil`, i.e. `Never?`.

func IsPrimitiveOrContainerOfPrimitive added in v1.0.0

func IsPrimitiveOrContainerOfPrimitive(referencedType Type) bool

func IsProperSubType added in v0.17.0

func IsProperSubType(subType Type, superType Type) bool

IsProperSubType is similar to IsSubType, i.e. it determines if the given subtype is a subtype of the given supertype, but returns false if the subtype and supertype refer to the same type.

func IsSameTypeKind added in v0.24.0

func IsSameTypeKind(subType Type, superType Type) bool

IsSameTypeKind determines if the given subtype belongs to the same kind as the supertype.

e.g: 'Never' type is a subtype of 'Integer', but not of the same kind as 'Integer'. Whereas, 'Int8' is both a subtype and also of same kind as 'Integer'.

func IsSubType

func IsSubType(subType Type, superType Type) bool

IsSubType determines if the given subtype is a subtype of the given supertype.

Types are subtypes of themselves.

NOTE: This method can be used to check the assignability of `subType` to `superType`. However, to check if a type *strictly* belongs to a certain category, then consider using `IsSameTypeKind` method. e.g: "Is type `T` an Integer type?". Using this method for the later use-case may produce incorrect results.

The differences between these methods is as follows:

  • IsSubType():

    To check the assignability, e.g: is argument type T is a sub-type of parameter type R? This is the more frequent use-case.

  • IsSameTypeKind():

    To check if a type strictly belongs to a certain category. e.g: Is the expression type T is any of the integer types, but nothing else. Another way to check is, asking the question of "if the subType is Never, should the check still pass?". A common code-smell for potential incorrect usage is, using IsSubType() method with a constant/pre-defined superType. e.g: IsSubType(<<someType>>, FixedPointType)

func IsValidAssignmentTargetExpression added in v0.8.0

func IsValidAssignmentTargetExpression(expression ast.Expression) bool

func IsValidCharacter added in v0.24.0

func IsValidCharacter(s string) bool

func IsValidEventParameterType added in v0.5.0

func IsValidEventParameterType(t Type, results map[*Member]bool) bool

IsValidEventParameterType returns true if the given type is a valid event parameter type.

Events currently only support a few simple Cadence types.

func MembersAsResolvers added in v0.39.0

func MembersAsResolvers(members []*Member) map[string]MemberResolver

func MembersFieldNames added in v0.39.0

func MembersFieldNames(members []*Member) []string

func MembersMapAsResolvers added in v0.39.0

func MembersMapAsResolvers(members *StringMemberOrderedMap) map[string]MemberResolver

func VisitThisAndNested added in v0.13.2

func VisitThisAndNested(t Type, visit func(ty Type))

Types

type Access added in v1.0.0

type Access interface {
	IsPrimitiveAccess() bool
	ID() TypeID
	String() string
	QualifiedString() string
	Equal(other Access) bool
	// PermitsAccess returns whether receiver access permits argument access
	PermitsAccess(Access) bool
	// contains filtered or unexported methods
}
var InaccessibleAccess Access = PrimitiveAccess(ast.AccessNone)
var UnauthorizedAccess Access = PrimitiveAccess(ast.AccessAll)

func AllSupportedEntitlements added in v1.0.0

func AllSupportedEntitlements(typ Type) Access

func NewAccessFromEntitlementOrderedSet added in v1.0.0

func NewAccessFromEntitlementOrderedSet(
	set *EntitlementOrderedSet,
	setKind EntitlementSetKind,
) Access

type AccessCheckMode

type AccessCheckMode uint
const (
	// AccessCheckModeDefault indicates the default access check mode should be used.
	AccessCheckModeDefault AccessCheckMode = iota
	// AccessCheckModeStrict indicates that access modifiers are required
	// and access checks are always enforced.
	AccessCheckModeStrict
	// AccessCheckModeNotSpecifiedRestricted indicates modifiers are optional.
	// Access is assumed private if not specified
	AccessCheckModeNotSpecifiedRestricted
	// AccessCheckModeNotSpecifiedUnrestricted indicates access modifiers are optional.
	// Access is assumed public if not specified
	AccessCheckModeNotSpecifiedUnrestricted
	// AccessCheckModeNone indicates access modifiers are optional and ignored.
	AccessCheckModeNone
)

func (AccessCheckMode) IsReadableAccess added in v0.36.0

func (mode AccessCheckMode) IsReadableAccess(access Access) bool

func (AccessCheckMode) IsWriteableAccess added in v0.36.0

func (mode AccessCheckMode) IsWriteableAccess(access Access) bool

func (AccessCheckMode) String

func (i AccessCheckMode) String() string

type ActivationHandlerFunc added in v0.42.1

type ActivationHandlerFunc func(common.Location) *VariableActivation

type AddressContractNamesResolver added in v0.25.0

type AddressContractNamesResolver func(address common.Address) ([]string, error)

type AddressType

type AddressType struct {
	// contains filtered or unexported fields
}

AddressType represents the address type

func (*AddressType) CheckInstantiated added in v1.0.0

func (*AddressType) CheckInstantiated(_ ast.HasPosition, _ common.MemoryGauge, _ func(err error))

func (*AddressType) ContainFieldsOrElements added in v1.0.0

func (*AddressType) ContainFieldsOrElements() bool

func (*AddressType) Equal

func (*AddressType) Equal(other Type) bool

func (*AddressType) GetMembers added in v0.7.0

func (t *AddressType) GetMembers() map[string]MemberResolver

func (*AddressType) ID

func (*AddressType) ID() TypeID

func (*AddressType) IsComparable added in v0.39.0

func (*AddressType) IsComparable() bool

func (*AddressType) IsEquatable added in v0.7.0

func (*AddressType) IsEquatable() bool

func (*AddressType) IsExportable added in v0.30.0

func (*AddressType) IsExportable(_ map[*Member]bool) bool

func (*AddressType) IsImportable added in v0.17.0

func (t *AddressType) IsImportable(_ map[*Member]bool) bool

func (*AddressType) IsInvalidType

func (*AddressType) IsInvalidType() bool

func (*AddressType) IsOrContainsReferenceType added in v1.0.0

func (*AddressType) IsOrContainsReferenceType() bool

func (*AddressType) IsPrimitiveType added in v1.0.0

func (*AddressType) IsPrimitiveType() bool

func (*AddressType) IsResourceType

func (*AddressType) IsResourceType() bool

func (*AddressType) IsStorable added in v0.5.0

func (*AddressType) IsStorable(_ map[*Member]bool) bool

func (*AddressType) IsSuperType added in v0.24.0

func (*AddressType) IsSuperType() bool

func (*AddressType) IsType

func (*AddressType) IsType()

func (*AddressType) Map added in v1.0.0

func (t *AddressType) Map(_ common.MemoryGauge, _ map[*TypeParameter]*TypeParameter, f func(Type) Type) Type

func (*AddressType) MaxInt

func (*AddressType) MaxInt() *big.Int

func (*AddressType) MinInt

func (*AddressType) MinInt() *big.Int

func (*AddressType) QualifiedString

func (*AddressType) QualifiedString() string

func (*AddressType) Resolve

func (*AddressType) RewriteWithIntersectionTypes added in v1.0.0

func (t *AddressType) RewriteWithIntersectionTypes() (Type, bool)

func (*AddressType) String

func (*AddressType) String() string

func (*AddressType) Tag added in v0.24.0

func (t *AddressType) Tag() TypeTag

func (*AddressType) TypeAnnotationState

func (*AddressType) TypeAnnotationState() TypeAnnotationState

func (*AddressType) Unify

type AlwaysFailingNonResourceCastingTypeError

type AlwaysFailingNonResourceCastingTypeError struct {
	ValueType  Type
	TargetType Type
	ast.Range
}

func (*AlwaysFailingNonResourceCastingTypeError) Error

func (*AlwaysFailingNonResourceCastingTypeError) IsUserError added in v0.25.0

type AlwaysFailingResourceCastingTypeError

type AlwaysFailingResourceCastingTypeError struct {
	ValueType  Type
	TargetType Type
	ast.Range
}

func (*AlwaysFailingResourceCastingTypeError) Error

func (*AlwaysFailingResourceCastingTypeError) IsUserError added in v0.25.0

type AmbiguousIntersectionTypeError added in v1.0.0

type AmbiguousIntersectionTypeError struct {
	ast.Range
}

func (*AmbiguousIntersectionTypeError) Error added in v1.0.0

func (*AmbiguousIntersectionTypeError) IsUserError added in v1.0.0

func (*AmbiguousIntersectionTypeError) IsUserError()

type ArgumentExpressionsCheck added in v0.9.0

type ArgumentExpressionsCheck func(
	checker *Checker,
	argumentExpressions []ast.Expression,
	invocationRange ast.HasPosition,
)

type Arity added in v0.39.14

type Arity struct {
	Min int
	Max int
}

func (*Arity) MaxCount added in v0.39.14

func (arity *Arity) MaxCount(parameterCount int) *int

func (*Arity) MinCount added in v0.39.14

func (arity *Arity) MinCount(parameterCount int) int

type ArrayExpressionTypes added in v0.26.0

type ArrayExpressionTypes struct {
	ArrayType     ArrayType
	ArgumentTypes []Type
}

type ArrayType

type ArrayType interface {
	ValueIndexableType
	EntitlementSupportingType
	// contains filtered or unexported methods
}

type AssignmentStatementTypes added in v0.26.0

type AssignmentStatementTypes struct {
	ValueType  Type
	TargetType Type
}

type AssignmentToConstantError

type AssignmentToConstantError struct {
	Name string
	ast.Range
}

func (*AssignmentToConstantError) Error

func (e *AssignmentToConstantError) Error() string

func (*AssignmentToConstantError) IsUserError added in v0.25.0

func (*AssignmentToConstantError) IsUserError()

func (*AssignmentToConstantError) SecondaryError added in v0.31.0

func (e *AssignmentToConstantError) SecondaryError() string

type AssignmentToConstantMemberError

type AssignmentToConstantMemberError struct {
	Name string
	ast.Range
}

func (*AssignmentToConstantMemberError) Error

func (*AssignmentToConstantMemberError) IsUserError added in v0.25.0

func (*AssignmentToConstantMemberError) IsUserError()

type AttachNonAttachmentError added in v0.36.0

type AttachNonAttachmentError struct {
	Type Type
	ast.Range
}

func (*AttachNonAttachmentError) Error added in v0.36.0

func (e *AttachNonAttachmentError) Error() string

func (*AttachNonAttachmentError) IsUserError added in v0.36.0

func (*AttachNonAttachmentError) IsUserError()

type AttachToInvalidTypeError added in v0.36.0

type AttachToInvalidTypeError struct {
	Type Type
	ast.Range
}

AttachToInvalidTypeError

func (*AttachToInvalidTypeError) Error added in v0.36.0

func (e *AttachToInvalidTypeError) Error() string

func (*AttachToInvalidTypeError) IsUserError added in v0.36.0

func (*AttachToInvalidTypeError) IsUserError()

type AttachmentsNotEnabledError added in v0.36.0

type AttachmentsNotEnabledError struct {
	ast.Range
}

AttachmentsNotEnabledError

func (*AttachmentsNotEnabledError) Error added in v0.36.0

func (*AttachmentsNotEnabledError) IsUserError added in v0.36.0

func (*AttachmentsNotEnabledError) IsUserError()

type BeforeExtractor

type BeforeExtractor struct {
	ExpressionExtractor *ast.ExpressionExtractor
	// contains filtered or unexported fields
}

func NewBeforeExtractor

func NewBeforeExtractor(memoryGauge common.MemoryGauge, report func(error)) *BeforeExtractor

func (*BeforeExtractor) ExtractBefore

func (e *BeforeExtractor) ExtractBefore(expression ast.Expression) ast.ExpressionExtraction

func (*BeforeExtractor) ExtractFunction

func (e *BeforeExtractor) ExtractFunction(
	_ *ast.ExpressionExtractor,
	expression *ast.FunctionExpression,
) ast.ExpressionExtraction

func (*BeforeExtractor) ExtractInvocation

func (e *BeforeExtractor) ExtractInvocation(
	extractor *ast.ExpressionExtractor,
	expression *ast.InvocationExpression,
) ast.ExpressionExtraction

type BinaryExpressionTypes added in v0.26.0

type BinaryExpressionTypes struct {
	ResultType Type
	LeftType   Type
	RightType  Type
}

type BinaryOperationKind

type BinaryOperationKind uint
const (
	BinaryOperationKindUnknown BinaryOperationKind = iota
	BinaryOperationKindArithmetic
	BinaryOperationKindNonEqualityComparison
	BinaryOperationKindBooleanLogic
	BinaryOperationKindEquality
	BinaryOperationKindNilCoalescing
	BinaryOperationKindBitwise
)

func (BinaryOperationKind) String

func (i BinaryOperationKind) String() string

type CapabilityType

type CapabilityType struct {
	BorrowType Type
	// contains filtered or unexported fields
}

func NewCapabilityType added in v0.24.0

func NewCapabilityType(memoryGauge common.MemoryGauge, borrowType Type) *CapabilityType

func (*CapabilityType) BaseType added in v0.5.0

func (t *CapabilityType) BaseType() Type

func (*CapabilityType) CheckInstantiated added in v1.0.0

func (t *CapabilityType) CheckInstantiated(pos ast.HasPosition, memoryGauge common.MemoryGauge, report func(err error))

func (*CapabilityType) ContainFieldsOrElements added in v1.0.0

func (*CapabilityType) ContainFieldsOrElements() bool

func (*CapabilityType) Equal

func (t *CapabilityType) Equal(other Type) bool

func (*CapabilityType) GetMembers added in v0.7.0

func (t *CapabilityType) GetMembers() map[string]MemberResolver

func (*CapabilityType) ID

func (t *CapabilityType) ID() TypeID

func (*CapabilityType) Instantiate added in v0.5.0

func (t *CapabilityType) Instantiate(
	_ common.MemoryGauge,
	typeArguments []Type,
	_ []*ast.TypeAnnotation,
	_ func(err error),
) Type

func (*CapabilityType) IsComparable added in v0.39.0

func (*CapabilityType) IsComparable() bool

func (*CapabilityType) IsEquatable added in v0.7.0

func (*CapabilityType) IsEquatable() bool

func (*CapabilityType) IsExportable added in v0.30.0

func (*CapabilityType) IsExportable(_ map[*Member]bool) bool

func (*CapabilityType) IsImportable added in v0.17.0

func (t *CapabilityType) IsImportable(_ map[*Member]bool) bool

func (*CapabilityType) IsInvalidType

func (t *CapabilityType) IsInvalidType() bool

func (*CapabilityType) IsOrContainsReferenceType added in v1.0.0

func (t *CapabilityType) IsOrContainsReferenceType() bool

func (*CapabilityType) IsPrimitiveType added in v1.0.0

func (*CapabilityType) IsPrimitiveType() bool

func (*CapabilityType) IsResourceType

func (*CapabilityType) IsResourceType() bool

func (*CapabilityType) IsStorable added in v0.5.0

func (*CapabilityType) IsStorable(_ map[*Member]bool) bool

func (*CapabilityType) IsType

func (*CapabilityType) IsType()

func (*CapabilityType) Map added in v1.0.0

func (t *CapabilityType) Map(gauge common.MemoryGauge, typeParamMap map[*TypeParameter]*TypeParameter, f func(Type) Type) Type

func (*CapabilityType) QualifiedString

func (t *CapabilityType) QualifiedString() string

func (*CapabilityType) Resolve

func (t *CapabilityType) Resolve(typeArguments *TypeParameterTypeOrderedMap) Type

func (*CapabilityType) RewriteWithIntersectionTypes added in v1.0.0

func (t *CapabilityType) RewriteWithIntersectionTypes() (Type, bool)

func (*CapabilityType) String

func (t *CapabilityType) String() string

func (*CapabilityType) Tag added in v0.24.0

func (t *CapabilityType) Tag() TypeTag

func (*CapabilityType) TypeAnnotationState

func (t *CapabilityType) TypeAnnotationState() TypeAnnotationState

func (*CapabilityType) TypeArguments added in v0.5.0

func (t *CapabilityType) TypeArguments() []Type

func (*CapabilityType) TypeParameters added in v0.5.0

func (t *CapabilityType) TypeParameters() []*TypeParameter

func (*CapabilityType) Unify

func (t *CapabilityType) Unify(
	other Type,
	typeParameters *TypeParameterTypeOrderedMap,
	report func(err error),
	memoryGauge common.MemoryGauge,
	outerRange ast.HasPosition,
) bool

type CastTypes added in v0.26.0

type CastTypes struct {
	ExprActualType Type
	TargetType     Type
	ExpectedType   Type
}

type CastingExpressionTypes added in v0.30.0

type CastingExpressionTypes struct {
	StaticValueType Type
	TargetType      Type
}

type CheckHandlerFunc added in v0.2.1

type CheckHandlerFunc func(checker *Checker, check func())

type Checker

type Checker struct {
	Location common.Location

	Program      *ast.Program
	PositionInfo *PositionInfo
	Config       *Config
	Elaboration  *Elaboration
	// contains filtered or unexported fields
}

func NewChecker

func NewChecker(
	program *ast.Program,
	location common.Location,
	memoryGauge common.MemoryGauge,
	config *Config,
) (*Checker, error)

func (*Checker) Check

func (checker *Checker) Check() error

func (*Checker) CheckProgram added in v0.27.0

func (checker *Checker) CheckProgram(program *ast.Program)

func (*Checker) CheckStatement added in v0.27.0

func (checker *Checker) CheckStatement(element ast.Statement)

func (*Checker) CheckerError

func (checker *Checker) CheckerError() *CheckerError

func (*Checker) ConvertType

func (checker *Checker) ConvertType(t ast.Type) Type

ConvertType converts an AST type representation to a sema type

func (*Checker) ConvertTypeAnnotation

func (checker *Checker) ConvertTypeAnnotation(typeAnnotation *ast.TypeAnnotation) TypeAnnotation

ConvertTypeAnnotation converts an AST type annotation representation to a sema type annotation

NOTE: type annotations are *NOT* checked!

func (*Checker) CurrentPurityScope added in v0.32.0

func (checker *Checker) CurrentPurityScope() PurityCheckScope

func (*Checker) EffectiveCompositeMemberAccess added in v1.0.0

func (checker *Checker) EffectiveCompositeMemberAccess(access Access) Access

func (*Checker) EnforcePurity added in v0.32.0

func (checker *Checker) EnforcePurity(operation ast.Element, purity FunctionPurity)

func (*Checker) EntryPointParameters added in v0.11.0

func (checker *Checker) EntryPointParameters() []Parameter

EntryPointParameters returns the parameters of the transaction or script, if any.

Returns nil if the program specifies both a valid transaction and entry point function declaration.

func (*Checker) InNewPurityScope added in v0.32.0

func (checker *Checker) InNewPurityScope(enforce bool, f func())

func (*Checker) IsChecked

func (checker *Checker) IsChecked() bool

func (*Checker) ObserveImpureOperation added in v0.32.0

func (checker *Checker) ObserveImpureOperation(operation ast.Element)

func (*Checker) PopPurityScope added in v0.32.0

func (checker *Checker) PopPurityScope() PurityCheckScope

func (*Checker) PushNewPurityScope added in v0.32.0

func (checker *Checker) PushNewPurityScope(enforce bool, depth int)

func (*Checker) ResetErrors

func (checker *Checker) ResetErrors()

func (*Checker) SetMemoryGauge added in v0.24.0

func (checker *Checker) SetMemoryGauge(gauge common.MemoryGauge)

func (*Checker) SubChecker added in v0.13.0

func (checker *Checker) SubChecker(program *ast.Program, location common.Location) (*Checker, error)

func (*Checker) TypeActivationDepth added in v0.2.0

func (checker *Checker) TypeActivationDepth() int

func (*Checker) ValueActivationDepth added in v0.2.0

func (checker *Checker) ValueActivationDepth() int

func (*Checker) VisitArrayExpression

func (checker *Checker) VisitArrayExpression(arrayExpression *ast.ArrayExpression) Type

func (*Checker) VisitAssignmentStatement

func (checker *Checker) VisitAssignmentStatement(assignment *ast.AssignmentStatement) (_ struct{})

func (*Checker) VisitAttachExpression added in v0.36.0

func (checker *Checker) VisitAttachExpression(expression *ast.AttachExpression) Type

func (*Checker) VisitAttachmentDeclaration added in v0.36.0

func (checker *Checker) VisitAttachmentDeclaration(declaration *ast.AttachmentDeclaration) (_ struct{})

func (*Checker) VisitBinaryExpression

func (checker *Checker) VisitBinaryExpression(expression *ast.BinaryExpression) Type

func (*Checker) VisitBoolExpression

func (checker *Checker) VisitBoolExpression(_ *ast.BoolExpression) Type

func (*Checker) VisitBreakStatement

func (checker *Checker) VisitBreakStatement(statement *ast.BreakStatement) (_ struct{})

func (*Checker) VisitCastingExpression

func (checker *Checker) VisitCastingExpression(expression *ast.CastingExpression) Type

func (*Checker) VisitCompositeDeclaration

func (checker *Checker) VisitCompositeDeclaration(declaration *ast.CompositeDeclaration) (_ struct{})

func (*Checker) VisitConditionalExpression

func (checker *Checker) VisitConditionalExpression(expression *ast.ConditionalExpression) Type

func (*Checker) VisitContinueStatement

func (checker *Checker) VisitContinueStatement(statement *ast.ContinueStatement) (_ struct{})

func (*Checker) VisitCreateExpression

func (checker *Checker) VisitCreateExpression(expression *ast.CreateExpression) Type

func (*Checker) VisitDestroyExpression

func (checker *Checker) VisitDestroyExpression(expression *ast.DestroyExpression) (resultType Type)

func (*Checker) VisitDictionaryExpression

func (checker *Checker) VisitDictionaryExpression(expression *ast.DictionaryExpression) Type

func (*Checker) VisitEmitStatement

func (checker *Checker) VisitEmitStatement(statement *ast.EmitStatement) (_ struct{})

func (*Checker) VisitEntitlementDeclaration added in v1.0.0

func (checker *Checker) VisitEntitlementDeclaration(declaration *ast.EntitlementDeclaration) (_ struct{})

func (*Checker) VisitEntitlementMappingDeclaration added in v1.0.0

func (checker *Checker) VisitEntitlementMappingDeclaration(declaration *ast.EntitlementMappingDeclaration) (_ struct{})

func (*Checker) VisitEnumCaseDeclaration added in v0.10.0

func (checker *Checker) VisitEnumCaseDeclaration(_ *ast.EnumCaseDeclaration) struct{}

func (*Checker) VisitExpression added in v0.16.0

func (checker *Checker) VisitExpression(expr ast.Expression, parent ast.Element, expectedType Type) Type

func (*Checker) VisitExpressionStatement

func (checker *Checker) VisitExpressionStatement(statement *ast.ExpressionStatement) (_ struct{})

func (*Checker) VisitExpressionWithForceType added in v0.16.0

func (checker *Checker) VisitExpressionWithForceType(expr ast.Expression, parent ast.Element, expectedType Type, forceType bool) Type

func (*Checker) VisitExpressionWithReferenceCheck added in v1.0.0

func (checker *Checker) VisitExpressionWithReferenceCheck(expr ast.Expression, parent ast.Element, targetType Type) Type

func (*Checker) VisitFieldDeclaration

func (checker *Checker) VisitFieldDeclaration(_ *ast.FieldDeclaration) struct{}

func (*Checker) VisitFixedPointExpression

func (checker *Checker) VisitFixedPointExpression(expression *ast.FixedPointExpression) Type

func (*Checker) VisitForStatement

func (checker *Checker) VisitForStatement(statement *ast.ForStatement) (_ struct{})

func (*Checker) VisitForceExpression

func (checker *Checker) VisitForceExpression(expression *ast.ForceExpression) Type

func (*Checker) VisitFunctionDeclaration

func (checker *Checker) VisitFunctionDeclaration(declaration *ast.FunctionDeclaration) (_ struct{})

func (*Checker) VisitFunctionExpression

func (checker *Checker) VisitFunctionExpression(expression *ast.FunctionExpression) Type

func (*Checker) VisitIdentifierExpression

func (checker *Checker) VisitIdentifierExpression(expression *ast.IdentifierExpression) Type

func (*Checker) VisitIfStatement

func (checker *Checker) VisitIfStatement(statement *ast.IfStatement) (_ struct{})

func (*Checker) VisitImportDeclaration

func (checker *Checker) VisitImportDeclaration(declaration *ast.ImportDeclaration) struct{}

func (*Checker) VisitIndexExpression

func (checker *Checker) VisitIndexExpression(expression *ast.IndexExpression) Type

func (*Checker) VisitIntegerExpression

func (checker *Checker) VisitIntegerExpression(expression *ast.IntegerExpression) Type

func (*Checker) VisitInterfaceDeclaration

func (checker *Checker) VisitInterfaceDeclaration(declaration *ast.InterfaceDeclaration) (_ struct{})

VisitInterfaceDeclaration checks the given interface declaration.

NOTE: This function assumes that the interface type was previously declared using `declareInterfaceType` and exists in `checker.Elaboration.InterfaceDeclarationTypes`, and that the members and nested declarations for the interface type were declared through `declareInterfaceMembers`.

func (*Checker) VisitInvocationExpression

func (checker *Checker) VisitInvocationExpression(invocationExpression *ast.InvocationExpression) Type

func (*Checker) VisitMemberExpression

func (checker *Checker) VisitMemberExpression(expression *ast.MemberExpression) Type

NOTE: only called if the member expression is *not* an assignment

func (*Checker) VisitNilExpression

func (checker *Checker) VisitNilExpression(_ *ast.NilExpression) Type

func (*Checker) VisitPathExpression

func (checker *Checker) VisitPathExpression(expression *ast.PathExpression) Type

func (*Checker) VisitPragmaDeclaration added in v0.7.0

func (checker *Checker) VisitPragmaDeclaration(declaration *ast.PragmaDeclaration) (_ struct{})

VisitPragmaDeclaration checks that the pragma declaration is valid. It is valid if the root expression is an identifier or invocation. Invocations must

func (*Checker) VisitReferenceExpression

func (checker *Checker) VisitReferenceExpression(referenceExpression *ast.ReferenceExpression) Type

VisitReferenceExpression checks a reference expression

func (*Checker) VisitRemoveStatement added in v0.36.0

func (checker *Checker) VisitRemoveStatement(statement *ast.RemoveStatement) (_ struct{})

func (*Checker) VisitReturnStatement

func (checker *Checker) VisitReturnStatement(statement *ast.ReturnStatement) (_ struct{})

func (*Checker) VisitSpecialFunctionDeclaration added in v0.25.0

func (checker *Checker) VisitSpecialFunctionDeclaration(declaration *ast.SpecialFunctionDeclaration) struct{}

func (*Checker) VisitStringExpression

func (checker *Checker) VisitStringExpression(expression *ast.StringExpression) Type

func (*Checker) VisitSwapStatement

func (checker *Checker) VisitSwapStatement(swap *ast.SwapStatement) (_ struct{})

func (*Checker) VisitSwitchStatement added in v0.10.0

func (checker *Checker) VisitSwitchStatement(statement *ast.SwitchStatement) (_ struct{})

func (*Checker) VisitTransactionDeclaration

func (checker *Checker) VisitTransactionDeclaration(declaration *ast.TransactionDeclaration) (_ struct{})

func (*Checker) VisitUnaryExpression

func (checker *Checker) VisitUnaryExpression(expression *ast.UnaryExpression) Type

func (*Checker) VisitVariableDeclaration

func (checker *Checker) VisitVariableDeclaration(declaration *ast.VariableDeclaration) (_ struct{})

func (*Checker) VisitVoidExpression added in v0.27.1

func (checker *Checker) VisitVoidExpression(_ *ast.VoidExpression) Type

func (*Checker) VisitWhileStatement

func (checker *Checker) VisitWhileStatement(statement *ast.WhileStatement) (_ struct{})

type CheckerError

type CheckerError struct {
	Location common.Location
	Codes    map[common.Location][]byte
	Errors   []error
}

func (CheckerError) ChildErrors

func (e CheckerError) ChildErrors() []error

func (CheckerError) Error

func (e CheckerError) Error() string

func (CheckerError) ImportLocation added in v0.12.1

func (e CheckerError) ImportLocation() common.Location

func (CheckerError) IsUserError added in v0.25.0

func (CheckerError) IsUserError()

func (CheckerError) Unwrap added in v0.42.8

func (e CheckerError) Unwrap() []error

type CompositeKindMismatchError

type CompositeKindMismatchError struct {
	ExpectedKind common.CompositeKind
	ActualKind   common.CompositeKind
	ast.Range
}

func (*CompositeKindMismatchError) Error

func (*CompositeKindMismatchError) IsUserError added in v0.25.0

func (*CompositeKindMismatchError) IsUserError()

func (*CompositeKindMismatchError) SecondaryError

func (e *CompositeKindMismatchError) SecondaryError() string

type CompositeKindedType

type CompositeKindedType interface {
	Type
	EntitlementSupportingType
	GetCompositeKind() common.CompositeKind
}

CompositeKindedType is a type which has a composite kind

type CompositeType

type CompositeType struct {
	Location    common.Location
	EnumRawType Type

	NestedTypes *StringTypeOrderedMap

	DefaultDestroyEvent *CompositeType

	Members *StringMemberOrderedMap

	Identifier            string
	Fields                []string
	ConstructorParameters []Parameter

	ExplicitInterfaceConformances []*InterfaceType
	Kind                          common.CompositeKind

	ConstructorPurity  FunctionPurity
	HasComputedMembers bool
	// Only applicable for native composite types
	ImportableBuiltin bool
	// contains filtered or unexported fields
}

func (*CompositeType) CheckInstantiated added in v1.0.0

func (t *CompositeType) CheckInstantiated(pos ast.HasPosition, memoryGauge common.MemoryGauge, report func(err error))

func (*CompositeType) ConstructorFunctionType added in v1.0.0

func (t *CompositeType) ConstructorFunctionType() *FunctionType

func (*CompositeType) ContainFieldsOrElements added in v1.0.0

func (t *CompositeType) ContainFieldsOrElements() bool

func (*CompositeType) EffectiveInterfaceConformanceSet added in v1.0.0

func (t *CompositeType) EffectiveInterfaceConformanceSet() *InterfaceSet

func (*CompositeType) EffectiveInterfaceConformances added in v1.0.0

func (t *CompositeType) EffectiveInterfaceConformances() []Conformance

func (*CompositeType) Equal

func (t *CompositeType) Equal(other Type) bool

func (*CompositeType) FieldPosition added in v0.21.3

func (t *CompositeType) FieldPosition(name string, declaration ast.CompositeLikeDeclaration) ast.Position

func (*CompositeType) GetBaseType added in v0.36.0

func (t *CompositeType) GetBaseType() Type

func (*CompositeType) GetCompositeKind

func (t *CompositeType) GetCompositeKind() common.CompositeKind

func (*CompositeType) GetContainerType

func (t *CompositeType) GetContainerType() Type

func (*CompositeType) GetLocation

func (t *CompositeType) GetLocation() common.Location

func (*CompositeType) GetMembers added in v0.7.0

func (t *CompositeType) GetMembers() map[string]MemberResolver

func (*CompositeType) GetNestedTypes added in v0.13.2

func (t *CompositeType) GetNestedTypes() *StringTypeOrderedMap

func (*CompositeType) ID

func (t *CompositeType) ID() TypeID

func (*CompositeType) InitializerEffectiveArgumentLabels added in v1.0.0

func (t *CompositeType) InitializerEffectiveArgumentLabels() []string

func (*CompositeType) InitializerFunctionType added in v1.0.0

func (t *CompositeType) InitializerFunctionType() *FunctionType

func (*CompositeType) IsComparable added in v0.39.0

func (*CompositeType) IsComparable() bool

func (*CompositeType) IsContainerType added in v0.20.3

func (t *CompositeType) IsContainerType() bool

func (*CompositeType) IsEquatable added in v0.7.0

func (t *CompositeType) IsEquatable() bool

func (*CompositeType) IsExportable added in v0.30.0

func (t *CompositeType) IsExportable(results map[*Member]bool) bool

func (*CompositeType) IsImportable added in v0.17.0

func (t *CompositeType) IsImportable(results map[*Member]bool) bool

func (*CompositeType) IsInvalidType

func (*CompositeType) IsInvalidType() bool

func (*CompositeType) IsOrContainsReferenceType added in v1.0.0

func (*CompositeType) IsOrContainsReferenceType() bool

func (*CompositeType) IsPrimitiveType added in v1.0.0

func (t *CompositeType) IsPrimitiveType() bool

func (*CompositeType) IsResourceType

func (t *CompositeType) IsResourceType() bool

func (*CompositeType) IsStorable added in v0.5.0

func (t *CompositeType) IsStorable(results map[*Member]bool) bool

func (*CompositeType) IsType

func (*CompositeType) IsType()

func (*CompositeType) IsValidIndexingType added in v0.36.0

func (t *CompositeType) IsValidIndexingType(ty Type) bool

func (*CompositeType) Map added in v1.0.0

func (*CompositeType) MemberMap added in v0.32.0

func (t *CompositeType) MemberMap() *StringMemberOrderedMap

func (*CompositeType) QualifiedIdentifier

func (t *CompositeType) QualifiedIdentifier() string

func (*CompositeType) QualifiedString

func (t *CompositeType) QualifiedString() string

func (*CompositeType) Resolve

func (*CompositeType) ResolveMembers added in v0.42.0

func (t *CompositeType) ResolveMembers()

func (*CompositeType) RewriteWithIntersectionTypes added in v1.0.0

func (t *CompositeType) RewriteWithIntersectionTypes() (result Type, rewritten bool)

func (*CompositeType) SetContainerType added in v0.17.0

func (t *CompositeType) SetContainerType(containerType Type)

func (*CompositeType) SetNestedType added in v0.39.0

func (t *CompositeType) SetNestedType(name string, nestedType ContainedType)

func (*CompositeType) String

func (t *CompositeType) String() string

func (*CompositeType) SupportedEntitlements added in v1.0.0

func (t *CompositeType) SupportedEntitlements() *EntitlementSet

func (*CompositeType) Tag added in v0.24.0

func (t *CompositeType) Tag() TypeTag

func (*CompositeType) TypeAnnotationState

func (t *CompositeType) TypeAnnotationState() TypeAnnotationState

func (*CompositeType) TypeIndexingElementType added in v0.36.0

func (t *CompositeType) TypeIndexingElementType(indexingType Type, _ func() ast.Range) (Type, error)

func (*CompositeType) Unify

type Config added in v0.26.0

type Config struct {
	// ContractValueHandler is used to construct the contract variable
	ContractValueHandler ContractValueHandlerFunc
	// MemberAccountAccessHandler is used to determine if the access of a member with account access modifier is valid
	MemberAccountAccessHandler MemberAccountAccessHandlerFunc
	// ValidTopLevelDeclarationsHandler is used to determine the kinds of declarations
	// which are valid at the top-level for a given location
	ValidTopLevelDeclarationsHandler ValidTopLevelDeclarationsHandlerFunc
	BaseTypeActivationHandler        ActivationHandlerFunc
	BaseValueActivationHandler       ActivationHandlerFunc
	// ImportHandler is used to resolve unresolved imports
	ImportHandler ImportHandlerFunc
	// CheckHandler is the function which is used for the checking of a program
	CheckHandler CheckHandlerFunc
	// LocationHandler is used to resolve locations
	LocationHandler LocationHandlerFunc
	// AccessCheckMode is the mode for access control checks.
	// It determines how access modifiers how existing and missing access modifiers are treated
	AccessCheckMode AccessCheckMode
	// ExtendedElaborationEnabled determines if extended elaboration information is generated
	ExtendedElaborationEnabled bool
	// SuggestionsEnabled determines if additional, potentially-computationally intensive,
	// suggested fixes are calculated when producing type errors
	SuggestionsEnabled bool
	// ErrorShortCircuitingEnabled determines if error short-circuiting is enabled.
	// When enabled, the checker will stop running once it encounters an error.
	// When disabled (the default), the checker reports the error then continues checking
	ErrorShortCircuitingEnabled bool
	// PositionInfoEnabled determines if position information is generated.
	// Position info includes origins, occurrences, member accesses, ranges, and function invocations
	PositionInfoEnabled bool
	// AllowNativeDeclarations determines if declarations may be native
	AllowNativeDeclarations bool
	// AllowStaticDeclarations determines if declarations may be static
	AllowStaticDeclarations bool
	// AttachmentsEnabled determines if attachments are enabled
	AttachmentsEnabled bool
}

type Conformance added in v1.0.0

type Conformance struct {
	InterfaceType        *InterfaceType
	ConformanceChainRoot *InterfaceType
}

type ConformanceError

type ConformanceError struct {
	CompositeDeclaration        ast.CompositeLikeDeclaration
	CompositeType               *CompositeType
	InterfaceType               *InterfaceType
	NestedInterfaceType         *InterfaceType
	InitializerMismatch         *InitializerMismatch
	MissingMembers              []*Member
	MemberMismatches            []MemberMismatch
	MissingNestedCompositeTypes []*CompositeType
	Pos                         ast.Position
}

func (*ConformanceError) EndPosition

func (*ConformanceError) Error

func (e *ConformanceError) Error() string

func (*ConformanceError) ErrorNotes added in v0.2.0

func (e *ConformanceError) ErrorNotes() (notes []errors.ErrorNote)

func (*ConformanceError) IsUserError added in v0.25.0

func (*ConformanceError) IsUserError()

func (*ConformanceError) SecondaryError added in v0.30.0

func (e *ConformanceError) SecondaryError() string

func (*ConformanceError) StartPosition

func (e *ConformanceError) StartPosition() ast.Position

type ConstantSizedArrayLiteralSizeError

type ConstantSizedArrayLiteralSizeError struct {
	ActualSize   int64
	ExpectedSize int64
	ast.Range
}

func (*ConstantSizedArrayLiteralSizeError) Error

func (*ConstantSizedArrayLiteralSizeError) IsUserError added in v0.25.0

func (*ConstantSizedArrayLiteralSizeError) IsUserError()

func (*ConstantSizedArrayLiteralSizeError) SecondaryError

func (e *ConstantSizedArrayLiteralSizeError) SecondaryError() string

type ConstantSizedType

type ConstantSizedType struct {
	Type Type

	Size int64
	// contains filtered or unexported fields
}

ConstantSizedType is a constant sized array type

func NewConstantSizedType added in v0.24.0

func NewConstantSizedType(memoryGauge common.MemoryGauge, typ Type, size int64) *ConstantSizedType

func (*ConstantSizedType) AllowsValueIndexingAssignment added in v0.7.0

func (*ConstantSizedType) AllowsValueIndexingAssignment() bool

func (*ConstantSizedType) CheckInstantiated added in v1.0.0

func (t *ConstantSizedType) CheckInstantiated(pos ast.HasPosition, memoryGauge common.MemoryGauge, report func(err error))

func (*ConstantSizedType) ContainFieldsOrElements added in v1.0.0

func (t *ConstantSizedType) ContainFieldsOrElements() bool

func (*ConstantSizedType) ElementType

func (t *ConstantSizedType) ElementType(_ bool) Type

func (*ConstantSizedType) Equal

func (t *ConstantSizedType) Equal(other Type) bool

func (*ConstantSizedType) GetMembers added in v0.7.0

func (t *ConstantSizedType) GetMembers() map[string]MemberResolver

func (*ConstantSizedType) ID

func (t *ConstantSizedType) ID() TypeID

func (*ConstantSizedType) IndexingType

func (t *ConstantSizedType) IndexingType() Type

func (*ConstantSizedType) IsComparable added in v0.39.0

func (t *ConstantSizedType) IsComparable() bool

func (*ConstantSizedType) IsEquatable added in v0.7.0

func (t *ConstantSizedType) IsEquatable() bool

func (*ConstantSizedType) IsExportable added in v0.30.0

func (t *ConstantSizedType) IsExportable(results map[*Member]bool) bool

func (*ConstantSizedType) IsImportable added in v0.17.0

func (t *ConstantSizedType) IsImportable(results map[*Member]bool) bool

func (*ConstantSizedType) IsInvalidType

func (t *ConstantSizedType) IsInvalidType() bool

func (*ConstantSizedType) IsOrContainsReferenceType added in v1.0.0

func (t *ConstantSizedType) IsOrContainsReferenceType() bool

func (*ConstantSizedType) IsPrimitiveType added in v1.0.0

func (t *ConstantSizedType) IsPrimitiveType() bool

func (*ConstantSizedType) IsResourceType

func (t *ConstantSizedType) IsResourceType() bool

func (*ConstantSizedType) IsStorable added in v0.5.0

func (t *ConstantSizedType) IsStorable(results map[*Member]bool) bool

func (*ConstantSizedType) IsType

func (*ConstantSizedType) IsType()

func (*ConstantSizedType) Map added in v1.0.0

func (t *ConstantSizedType) Map(gauge common.MemoryGauge, typeParamMap map[*TypeParameter]*TypeParameter, f func(Type) Type) Type

func (*ConstantSizedType) QualifiedString

func (t *ConstantSizedType) QualifiedString() string

func (*ConstantSizedType) Resolve

func (t *ConstantSizedType) Resolve(typeArguments *TypeParameterTypeOrderedMap) Type

func (*ConstantSizedType) RewriteWithIntersectionTypes added in v1.0.0

func (t *ConstantSizedType) RewriteWithIntersectionTypes() (Type, bool)

func (*ConstantSizedType) String

func (t *ConstantSizedType) String() string

func (*ConstantSizedType) SupportedEntitlements added in v1.0.0

func (t *ConstantSizedType) SupportedEntitlements() *EntitlementSet

func (*ConstantSizedType) Tag added in v0.24.0

func (t *ConstantSizedType) Tag() TypeTag

func (*ConstantSizedType) TypeAnnotationState

func (t *ConstantSizedType) TypeAnnotationState() TypeAnnotationState

func (*ConstantSizedType) Unify

func (t *ConstantSizedType) Unify(
	other Type,
	typeParameters *TypeParameterTypeOrderedMap,
	report func(err error),
	memoryGauge common.MemoryGauge,
	outerRange ast.HasPosition,
) bool

type ContainedType

type ContainedType interface {
	Type
	GetContainerType() Type
	SetContainerType(containerType Type)
}

ContainedType is a type which might have a container type

type ContainerKind

type ContainerKind uint
const (
	ContainerKindUnknown ContainerKind = iota
	ContainerKindInterface
	ContainerKindComposite
)

func (ContainerKind) String

func (i ContainerKind) String() string

type ContainerType

type ContainerType interface {
	Type
	IsContainerType() bool
	GetNestedTypes() *StringTypeOrderedMap
}

ContainerType is a type which might have nested types

type ContractValueHandlerFunc added in v0.27.0

type ContractValueHandlerFunc func(
	checker *Checker,
	declaration *ast.CompositeDeclaration,
	compositeType *CompositeType,
) ValueDeclaration

type ControlStatementError

type ControlStatementError struct {
	ControlStatement common.ControlStatement
	ast.Range
}

func (*ControlStatementError) Error

func (e *ControlStatementError) Error() string

func (*ControlStatementError) IsUserError added in v0.25.0

func (*ControlStatementError) IsUserError()

func (*ControlStatementError) SecondaryError added in v0.31.0

func (e *ControlStatementError) SecondaryError() string

type CryptoAlgorithm added in v0.14.4

type CryptoAlgorithm interface {
	RawValue() uint8
	Name() string
	DocString() string
}

type CyclicConformanceError added in v1.0.0

type CyclicConformanceError struct {
	InterfaceType *InterfaceType
	ast.Range
}

CyclicConformanceError

func (CyclicConformanceError) Error added in v1.0.0

func (e CyclicConformanceError) Error() string

func (CyclicConformanceError) IsUserError added in v1.0.0

func (CyclicConformanceError) IsUserError()

type CyclicEntitlementMappingError added in v1.0.0

type CyclicEntitlementMappingError struct {
	Map          *EntitlementMapType
	IncludedType *EntitlementMapType
	ast.Range
}

CyclicEntitlementMappingError

func (*CyclicEntitlementMappingError) Error added in v1.0.0

func (*CyclicEntitlementMappingError) IsUserError added in v1.0.0

func (*CyclicEntitlementMappingError) IsUserError()

type CyclicImportsError added in v0.10.0

type CyclicImportsError struct {
	Location common.Location
	ast.Range
}

func (*CyclicImportsError) Error added in v0.10.0

func (e *CyclicImportsError) Error() string

func (*CyclicImportsError) IsUserError added in v0.25.0

func (*CyclicImportsError) IsUserError()

type DeclarationKindMismatchError

type DeclarationKindMismatchError struct {
	ExpectedDeclarationKind common.DeclarationKind
	ActualDeclarationKind   common.DeclarationKind
	ast.Range
}

func (*DeclarationKindMismatchError) Error

func (*DeclarationKindMismatchError) IsUserError added in v0.25.0

func (*DeclarationKindMismatchError) IsUserError()

func (*DeclarationKindMismatchError) SecondaryError

func (e *DeclarationKindMismatchError) SecondaryError() string

type DefaultDestroyEventInNonResourceError added in v1.0.0

type DefaultDestroyEventInNonResourceError struct {
	Kind string
	ast.Range
}

func (*DefaultDestroyEventInNonResourceError) Error added in v1.0.0

func (*DefaultDestroyEventInNonResourceError) IsUserError added in v1.0.0

type DefaultDestroyInvalidArgumentError added in v1.0.0

type DefaultDestroyInvalidArgumentError struct {
	ast.Range
	Kind DefaultDestroyInvalidArgumentKind
}

func (*DefaultDestroyInvalidArgumentError) Error added in v1.0.0

func (*DefaultDestroyInvalidArgumentError) IsUserError added in v1.0.0

func (*DefaultDestroyInvalidArgumentError) IsUserError()

func (*DefaultDestroyInvalidArgumentError) SecondaryError added in v1.0.0

func (e *DefaultDestroyInvalidArgumentError) SecondaryError() string

type DefaultDestroyInvalidArgumentKind added in v1.0.0

type DefaultDestroyInvalidArgumentKind int
const (
	NonDictionaryIndexExpression DefaultDestroyInvalidArgumentKind = iota
	ReferenceTypedMemberAccess
	InvalidIdentifier
	InvalidExpression
)

type DefaultDestroyInvalidParameterError added in v1.0.0

type DefaultDestroyInvalidParameterError struct {
	ParamType Type
	ast.Range
}

func (*DefaultDestroyInvalidParameterError) Error added in v1.0.0

func (*DefaultDestroyInvalidParameterError) IsUserError added in v1.0.0

func (*DefaultDestroyInvalidParameterError) IsUserError()

type DictionaryEntryType

type DictionaryEntryType struct {
	KeyType   Type
	ValueType Type
}

type DictionaryExpressionTypes added in v0.26.0

type DictionaryExpressionTypes struct {
	DictionaryType *DictionaryType
	EntryTypes     []DictionaryEntryType
}

type DictionaryType

type DictionaryType struct {
	KeyType   Type
	ValueType Type
	// contains filtered or unexported fields
}

func NewDictionaryType added in v0.24.0

func NewDictionaryType(memoryGauge common.MemoryGauge, keyType, valueType Type) *DictionaryType

func (*DictionaryType) AllowsValueIndexingAssignment added in v0.7.0

func (*DictionaryType) AllowsValueIndexingAssignment() bool

func (*DictionaryType) CheckInstantiated added in v1.0.0

func (t *DictionaryType) CheckInstantiated(pos ast.HasPosition, memoryGauge common.MemoryGauge, report func(err error))

func (*DictionaryType) ContainFieldsOrElements added in v1.0.0

func (*DictionaryType) ContainFieldsOrElements() bool

func (*DictionaryType) ElementType

func (t *DictionaryType) ElementType(_ bool) Type

func (*DictionaryType) Equal

func (t *DictionaryType) Equal(other Type) bool

func (*DictionaryType) GetMembers added in v0.7.0

func (t *DictionaryType) GetMembers() map[string]MemberResolver

func (*DictionaryType) ID

func (t *DictionaryType) ID() TypeID

func (*DictionaryType) IndexingType

func (t *DictionaryType) IndexingType() Type

func (*DictionaryType) IsComparable added in v0.39.0

func (*DictionaryType) IsComparable() bool

func (*DictionaryType) IsEquatable added in v0.7.0

func (t *DictionaryType) IsEquatable() bool

func (*DictionaryType) IsExportable added in v0.30.0

func (t *DictionaryType) IsExportable(results map[*Member]bool) bool

func (*DictionaryType) IsImportable added in v0.17.0

func (t *DictionaryType) IsImportable(results map[*Member]bool) bool

func (*DictionaryType) IsInvalidType

func (t *DictionaryType) IsInvalidType() bool

func (*DictionaryType) IsOrContainsReferenceType added in v1.0.0

func (t *DictionaryType) IsOrContainsReferenceType() bool

func (*DictionaryType) IsPrimitiveType added in v1.0.0

func (t *DictionaryType) IsPrimitiveType() bool

func (*DictionaryType) IsResourceType

func (t *DictionaryType) IsResourceType() bool

func (*DictionaryType) IsStorable added in v0.5.0

func (t *DictionaryType) IsStorable(results map[*Member]bool) bool

func (*DictionaryType) IsType

func (*DictionaryType) IsType()

func (*DictionaryType) Map added in v1.0.0

func (t *DictionaryType) Map(gauge common.MemoryGauge, typeParamMap map[*TypeParameter]*TypeParameter, f func(Type) Type) Type

func (*DictionaryType) QualifiedString

func (t *DictionaryType) QualifiedString() string

func (*DictionaryType) Resolve

func (t *DictionaryType) Resolve(typeArguments *TypeParameterTypeOrderedMap) Type

func (*DictionaryType) RewriteWithIntersectionTypes added in v1.0.0

func (t *DictionaryType) RewriteWithIntersectionTypes() (Type, bool)

func (*DictionaryType) String

func (t *DictionaryType) String() string

func (*DictionaryType) SupportedEntitlements added in v1.0.0

func (t *DictionaryType) SupportedEntitlements() *EntitlementSet

func (*DictionaryType) Tag added in v0.24.0

func (t *DictionaryType) Tag() TypeTag

func (*DictionaryType) TypeAnnotationState

func (t *DictionaryType) TypeAnnotationState() TypeAnnotationState

func (*DictionaryType) Unify

func (t *DictionaryType) Unify(
	other Type,
	typeParameters *TypeParameterTypeOrderedMap,
	report func(err error),
	memoryGauge common.MemoryGauge,
	outerRange ast.HasPosition,
) bool

type DirectEntitlementAnnotationError added in v1.0.0

type DirectEntitlementAnnotationError struct {
	ast.Range
}

DirectEntitlementAnnotationError

func (*DirectEntitlementAnnotationError) Error added in v1.0.0

func (*DirectEntitlementAnnotationError) IsUserError added in v1.0.0

func (*DirectEntitlementAnnotationError) IsUserError()

type DisjunctionOrderedSet added in v1.0.0

type DisjunctionOrderedSet = orderedmap.OrderedMap[string, *EntitlementOrderedSet]

DisjunctionOrderedSet is a set of entitlement disjunctions, keyed by disjunctionKey

type DuplicateConformanceError

type DuplicateConformanceError struct {
	CompositeKindedType CompositeKindedType
	InterfaceType       *InterfaceType
	ast.Range
}

DuplicateConformanceError

TODO: just make this a warning?

func (*DuplicateConformanceError) Error

func (e *DuplicateConformanceError) Error() string

func (*DuplicateConformanceError) IsUserError added in v0.25.0

func (*DuplicateConformanceError) IsUserError()

type DuplicateEntitlementMappingInclusionError added in v1.0.0

type DuplicateEntitlementMappingInclusionError struct {
	Map          *EntitlementMapType
	IncludedType *EntitlementMapType
	ast.Range
}

DuplicateEntitlementMappingInclusionError

func (*DuplicateEntitlementMappingInclusionError) Error added in v1.0.0

func (*DuplicateEntitlementMappingInclusionError) IsUserError added in v1.0.0

type Elaboration

type Elaboration struct {
	TransactionTypes []*TransactionType
	// contains filtered or unexported fields
}

func NewElaboration

func NewElaboration(gauge common.MemoryGauge) *Elaboration

func (*Elaboration) AllExpressionTypes added in v0.35.0

func (e *Elaboration) AllExpressionTypes() map[ast.Expression]ExpressionTypes

func (*Elaboration) AllStaticCastTypes added in v0.30.0

func (e *Elaboration) AllStaticCastTypes() map[*ast.CastingExpression]CastTypes

func (*Elaboration) ArrayExpressionTypes added in v0.26.0

func (e *Elaboration) ArrayExpressionTypes(expression *ast.ArrayExpression) (types ArrayExpressionTypes)

func (*Elaboration) AssignmentStatementTypes added in v0.26.0

func (e *Elaboration) AssignmentStatementTypes(assignment *ast.AssignmentStatement) (types AssignmentStatementTypes)

func (*Elaboration) AttachTypes added in v1.0.0

func (e *Elaboration) AttachTypes(
	expr *ast.AttachExpression,
) (
	ty *CompositeType,
)

func (*Elaboration) AttachmentAccessTypes added in v0.36.0

func (e *Elaboration) AttachmentAccessTypes(
	expression *ast.IndexExpression,
) (
	ty Type, ok bool,
)

func (*Elaboration) AttachmentRemoveTypes added in v0.36.0

func (e *Elaboration) AttachmentRemoveTypes(
	stmt *ast.RemoveStatement,
) (
	ty Type,
)

func (*Elaboration) BinaryExpressionTypes added in v0.26.0

func (e *Elaboration) BinaryExpressionTypes(expression *ast.BinaryExpression) (types BinaryExpressionTypes)

func (*Elaboration) CastingExpressionTypes added in v0.30.0

func (e *Elaboration) CastingExpressionTypes(expression *ast.CastingExpression) (types CastingExpressionTypes)

func (*Elaboration) CompositeDeclarationType added in v0.30.0

func (e *Elaboration) CompositeDeclarationType(declaration ast.CompositeLikeDeclaration) *CompositeType

func (*Elaboration) CompositeNestedDeclarations

func (e *Elaboration) CompositeNestedDeclarations(declaration ast.CompositeLikeDeclaration) map[string]ast.Declaration

func (*Elaboration) CompositeType added in v0.30.0

func (e *Elaboration) CompositeType(typeID common.TypeID) *CompositeType

func (*Elaboration) CompositeTypeDeclaration added in v0.30.0

func (e *Elaboration) CompositeTypeDeclaration(compositeType *CompositeType) (decl ast.CompositeLikeDeclaration, ok bool)

func (*Elaboration) ConstructorFunctionType added in v0.30.0

func (e *Elaboration) ConstructorFunctionType(initializer *ast.SpecialFunctionDeclaration) *FunctionType

func (*Elaboration) DefaultDestroyDeclaration added in v1.0.0

func (e *Elaboration) DefaultDestroyDeclaration(declaration ast.Declaration) ast.CompositeLikeDeclaration

func (*Elaboration) DictionaryExpressionTypes added in v0.26.0

func (e *Elaboration) DictionaryExpressionTypes(
	expression *ast.DictionaryExpression,
) (types DictionaryExpressionTypes)

func (*Elaboration) EmitStatementEventType added in v0.30.0

func (e *Elaboration) EmitStatementEventType(statement *ast.EmitStatement) *CompositeType

func (*Elaboration) EntitlementDeclarationType added in v1.0.0

func (e *Elaboration) EntitlementDeclarationType(declaration *ast.EntitlementDeclaration) *EntitlementType

func (*Elaboration) EntitlementMapDeclarationType added in v1.0.0

func (e *Elaboration) EntitlementMapDeclarationType(declaration *ast.EntitlementMappingDeclaration) *EntitlementMapType

func (*Elaboration) EntitlementMapType added in v1.0.0

func (e *Elaboration) EntitlementMapType(typeID common.TypeID) *EntitlementMapType

func (*Elaboration) EntitlementMapTypeDeclaration added in v1.0.0

func (e *Elaboration) EntitlementMapTypeDeclaration(entitlementMapType *EntitlementMapType) *ast.EntitlementMappingDeclaration

func (*Elaboration) EntitlementType added in v1.0.0

func (e *Elaboration) EntitlementType(typeID common.TypeID) *EntitlementType

func (*Elaboration) EntitlementTypeDeclaration added in v1.0.0

func (e *Elaboration) EntitlementTypeDeclaration(entitlementType *EntitlementType) *ast.EntitlementDeclaration

func (*Elaboration) ExpressionTypes added in v0.35.0

func (e *Elaboration) ExpressionTypes(expression ast.Expression) ExpressionTypes

func (*Elaboration) FixedPointExpression added in v0.16.0

func (e *Elaboration) FixedPointExpression(expression *ast.FixedPointExpression) Type

func (*Elaboration) ForEachGlobalType added in v0.30.0

func (e *Elaboration) ForEachGlobalType(f func(name string, variable *Variable))

func (*Elaboration) ForEachGlobalValue added in v0.30.0

func (e *Elaboration) ForEachGlobalValue(f func(name string, variable *Variable))

func (*Elaboration) ForStatementType added in v1.0.0

func (e *Elaboration) ForStatementType(statement *ast.ForStatement) (types ForStatementTypes)

func (*Elaboration) ForceExpressionType added in v0.30.0

func (e *Elaboration) ForceExpressionType(expression *ast.ForceExpression) Type

func (*Elaboration) FunctionDeclarationFunctionType added in v0.30.0

func (e *Elaboration) FunctionDeclarationFunctionType(declaration *ast.FunctionDeclaration) *FunctionType

func (*Elaboration) FunctionEntryPointType added in v0.13.0

func (e *Elaboration) FunctionEntryPointType() (*FunctionType, error)

FunctionEntryPointType returns the type of the entry point function declaration, if any.

Returns an error if no valid entry point function declaration exists.

func (*Elaboration) FunctionExpressionFunctionType

func (e *Elaboration) FunctionExpressionFunctionType(expression *ast.FunctionExpression) *FunctionType

func (*Elaboration) GetGlobalType added in v0.30.0

func (e *Elaboration) GetGlobalType(name string) (*Variable, bool)

func (*Elaboration) GetGlobalValue added in v0.30.0

func (e *Elaboration) GetGlobalValue(name string) (*Variable, bool)

func (*Elaboration) GetSemanticAccess added in v1.0.0

func (e *Elaboration) GetSemanticAccess(access ast.Access) (semaAccess Access, present bool)

func (*Elaboration) IdentifierInInvocationType added in v0.30.0

func (e *Elaboration) IdentifierInInvocationType(expression *ast.IdentifierExpression) Type

func (*Elaboration) ImportDeclarationsResolvedLocations added in v0.10.0

func (e *Elaboration) ImportDeclarationsResolvedLocations(declaration *ast.ImportDeclaration) []ResolvedLocation

func (*Elaboration) IndexExpressionTypes added in v0.26.0

func (e *Elaboration) IndexExpressionTypes(expression *ast.IndexExpression) (types IndexExpressionTypes)

func (*Elaboration) IntegerExpressionType added in v0.16.0

func (e *Elaboration) IntegerExpressionType(expression *ast.IntegerExpression) Type

func (*Elaboration) InterfaceDeclarationType added in v0.30.0

func (e *Elaboration) InterfaceDeclarationType(declaration *ast.InterfaceDeclaration) *InterfaceType

func (*Elaboration) InterfaceNestedDeclarations

func (e *Elaboration) InterfaceNestedDeclarations(declaration *ast.InterfaceDeclaration) map[string]ast.Declaration

func (*Elaboration) InterfaceType added in v0.30.0

func (e *Elaboration) InterfaceType(typeID common.TypeID) *InterfaceType

func (*Elaboration) InterfaceTypeDeclaration added in v0.30.0

func (e *Elaboration) InterfaceTypeDeclaration(interfaceType *InterfaceType) *ast.InterfaceDeclaration

func (*Elaboration) InvocationExpressionTypes added in v0.26.0

func (e *Elaboration) InvocationExpressionTypes(
	expression *ast.InvocationExpression,
) (types InvocationExpressionTypes)

func (*Elaboration) IsChecking added in v0.13.0

func (e *Elaboration) IsChecking() bool

func (*Elaboration) IsNestedResourceMoveExpression added in v0.20.0

func (e *Elaboration) IsNestedResourceMoveExpression(expression ast.Expression) bool

func (*Elaboration) MemberExpressionExpectedType added in v0.30.0

func (e *Elaboration) MemberExpressionExpectedType(expression *ast.MemberExpression) Type

func (*Elaboration) MemberExpressionMemberAccessInfo added in v1.0.0

func (e *Elaboration) MemberExpressionMemberAccessInfo(expression *ast.MemberExpression) (memberInfo MemberAccessInfo, ok bool)

func (*Elaboration) NumberConversionArgumentTypes added in v0.25.0

func (e *Elaboration) NumberConversionArgumentTypes(
	expression ast.Expression,
) (
	types NumberConversionArgumentTypes,
)

func (*Elaboration) PostConditionsRewrite

func (e *Elaboration) PostConditionsRewrite(conditions *ast.Conditions) (rewrite PostConditionsRewrite)

func (*Elaboration) ReferenceExpressionBorrowType added in v0.30.0

func (e *Elaboration) ReferenceExpressionBorrowType(expression *ast.ReferenceExpression) Type

func (*Elaboration) ReturnStatementTypes added in v0.26.0

func (e *Elaboration) ReturnStatementTypes(statement *ast.ReturnStatement) (types ReturnStatementTypes)

func (*Elaboration) RuntimeCastTypes added in v0.25.0

func (e *Elaboration) RuntimeCastTypes(expression *ast.CastingExpression) (types RuntimeCastTypes)

func (*Elaboration) SetArrayExpressionTypes added in v0.30.0

func (e *Elaboration) SetArrayExpressionTypes(expression *ast.ArrayExpression, types ArrayExpressionTypes)

func (*Elaboration) SetAssignmentStatementTypes added in v0.30.0

func (e *Elaboration) SetAssignmentStatementTypes(
	assignment *ast.AssignmentStatement,
	types AssignmentStatementTypes,
)

func (*Elaboration) SetAttachTypes added in v1.0.0

func (e *Elaboration) SetAttachTypes(
	expr *ast.AttachExpression,
	ty *CompositeType,
)

func (*Elaboration) SetAttachmentAccessTypes added in v0.36.0

func (e *Elaboration) SetAttachmentAccessTypes(
	expression *ast.IndexExpression,
	ty Type,
)

func (*Elaboration) SetAttachmentRemoveTypes added in v0.36.0

func (e *Elaboration) SetAttachmentRemoveTypes(
	stmt *ast.RemoveStatement,
	ty Type,
)

func (*Elaboration) SetBinaryExpressionTypes added in v0.30.0

func (e *Elaboration) SetBinaryExpressionTypes(expression *ast.BinaryExpression, types BinaryExpressionTypes)

func (*Elaboration) SetCastingExpressionTypes added in v0.30.0

func (e *Elaboration) SetCastingExpressionTypes(
	expression *ast.CastingExpression,
	types CastingExpressionTypes,
)

func (*Elaboration) SetCompositeDeclarationType added in v0.30.0

func (e *Elaboration) SetCompositeDeclarationType(
	declaration ast.CompositeLikeDeclaration,
	compositeType *CompositeType,
)

func (*Elaboration) SetCompositeNestedDeclarations added in v0.30.0

func (e *Elaboration) SetCompositeNestedDeclarations(
	declaration ast.CompositeLikeDeclaration,
	nestedDeclaration map[string]ast.Declaration,
)

func (*Elaboration) SetCompositeType added in v0.30.0

func (e *Elaboration) SetCompositeType(typeID TypeID, ty *CompositeType)

func (*Elaboration) SetCompositeTypeDeclaration added in v0.30.0

func (e *Elaboration) SetCompositeTypeDeclaration(
	compositeType *CompositeType,
	declaration ast.CompositeLikeDeclaration,
)

func (*Elaboration) SetConstructorFunctionType added in v0.30.0

func (e *Elaboration) SetConstructorFunctionType(
	initializer *ast.SpecialFunctionDeclaration,
	functionType *FunctionType,
)

func (*Elaboration) SetDefaultDestroyDeclaration added in v1.0.0

func (e *Elaboration) SetDefaultDestroyDeclaration(
	declaration ast.Declaration,
	eventDeclaration ast.CompositeLikeDeclaration,
)

func (*Elaboration) SetDictionaryExpressionTypes added in v0.30.0

func (e *Elaboration) SetDictionaryExpressionTypes(
	expression *ast.DictionaryExpression,
	types DictionaryExpressionTypes,
)

func (*Elaboration) SetEmitStatementEventType added in v0.30.0

func (e *Elaboration) SetEmitStatementEventType(statement *ast.EmitStatement, compositeType *CompositeType)

func (*Elaboration) SetEntitlementDeclarationWithType added in v1.0.0

func (e *Elaboration) SetEntitlementDeclarationWithType(
	declaration *ast.EntitlementDeclaration,
	entitlementType *EntitlementType,
)

func (*Elaboration) SetEntitlementMapDeclarationWithType added in v1.0.0

func (e *Elaboration) SetEntitlementMapDeclarationWithType(
	declaration *ast.EntitlementMappingDeclaration,
	entitlementMapType *EntitlementMapType,
)

func (*Elaboration) SetEntitlementMapType added in v1.0.0

func (e *Elaboration) SetEntitlementMapType(typeID TypeID, ty *EntitlementMapType)

func (*Elaboration) SetEntitlementType added in v1.0.0

func (e *Elaboration) SetEntitlementType(typeID TypeID, ty *EntitlementType)

func (*Elaboration) SetExpressionTypes added in v0.35.0

func (e *Elaboration) SetExpressionTypes(expression ast.Expression, types ExpressionTypes)

func (*Elaboration) SetFixedPointExpression added in v0.30.0

func (e *Elaboration) SetFixedPointExpression(expression *ast.FixedPointExpression, ty Type)

func (*Elaboration) SetForStatementType added in v1.0.0

func (e *Elaboration) SetForStatementType(statement *ast.ForStatement, types ForStatementTypes)

func (*Elaboration) SetForceExpressionType added in v0.30.0

func (e *Elaboration) SetForceExpressionType(expression *ast.ForceExpression, ty Type)

func (*Elaboration) SetFunctionDeclarationFunctionType added in v0.30.0

func (e *Elaboration) SetFunctionDeclarationFunctionType(
	declaration *ast.FunctionDeclaration,
	functionType *FunctionType,
)

func (*Elaboration) SetFunctionExpressionFunctionType added in v0.30.0

func (e *Elaboration) SetFunctionExpressionFunctionType(
	expression *ast.FunctionExpression,
	functionType *FunctionType,
)

func (*Elaboration) SetGlobalType added in v0.30.0

func (e *Elaboration) SetGlobalType(name string, variable *Variable)

func (*Elaboration) SetGlobalValue added in v0.30.0

func (e *Elaboration) SetGlobalValue(name string, variable *Variable)

func (*Elaboration) SetIdentifierInInvocationType added in v0.30.0

func (e *Elaboration) SetIdentifierInInvocationType(expression *ast.IdentifierExpression, valueType Type)

func (*Elaboration) SetImportDeclarationsResolvedLocations added in v0.30.0

func (e *Elaboration) SetImportDeclarationsResolvedLocations(
	declaration *ast.ImportDeclaration,
	locations []ResolvedLocation,
)

func (*Elaboration) SetIndexExpressionTypes added in v0.30.0

func (e *Elaboration) SetIndexExpressionTypes(expression *ast.IndexExpression, types IndexExpressionTypes)

func (*Elaboration) SetIntegerExpressionType added in v0.30.0

func (e *Elaboration) SetIntegerExpressionType(expression *ast.IntegerExpression, actualType Type)

func (*Elaboration) SetInterfaceDeclarationWithType added in v1.0.0

func (e *Elaboration) SetInterfaceDeclarationWithType(
	declaration *ast.InterfaceDeclaration,
	interfaceType *InterfaceType,
)

func (*Elaboration) SetInterfaceNestedDeclarations added in v0.30.0

func (e *Elaboration) SetInterfaceNestedDeclarations(
	declaration *ast.InterfaceDeclaration,
	nestedDeclaration map[string]ast.Declaration,
)

func (*Elaboration) SetInterfaceType added in v0.30.0

func (e *Elaboration) SetInterfaceType(typeID TypeID, ty *InterfaceType)

func (*Elaboration) SetInvocationExpressionTypes added in v0.30.0

func (e *Elaboration) SetInvocationExpressionTypes(
	expression *ast.InvocationExpression,
	types InvocationExpressionTypes,
)

func (*Elaboration) SetIsNestedResourceMoveExpression added in v0.30.0

func (e *Elaboration) SetIsNestedResourceMoveExpression(expression ast.Expression)

func (*Elaboration) SetMemberExpressionExpectedType added in v0.30.0

func (e *Elaboration) SetMemberExpressionExpectedType(expression *ast.MemberExpression, expectedType Type)

func (*Elaboration) SetMemberExpressionMemberAccessInfo added in v1.0.0

func (e *Elaboration) SetMemberExpressionMemberAccessInfo(expression *ast.MemberExpression, memberAccessInfo MemberAccessInfo)

func (*Elaboration) SetNumberConversionArgumentTypes added in v0.30.0

func (e *Elaboration) SetNumberConversionArgumentTypes(
	expression ast.Expression,
	types NumberConversionArgumentTypes,
)

func (*Elaboration) SetPostConditionsRewrite added in v0.30.0

func (e *Elaboration) SetPostConditionsRewrite(conditions *ast.Conditions, rewrite PostConditionsRewrite)

func (*Elaboration) SetReferenceExpressionBorrowType added in v0.30.0

func (e *Elaboration) SetReferenceExpressionBorrowType(expression *ast.ReferenceExpression, ty Type)

func (*Elaboration) SetReturnStatementTypes added in v0.30.0

func (e *Elaboration) SetReturnStatementTypes(statement *ast.ReturnStatement, types ReturnStatementTypes)

func (*Elaboration) SetRuntimeCastTypes added in v0.30.0

func (e *Elaboration) SetRuntimeCastTypes(expression *ast.CastingExpression, types RuntimeCastTypes)

func (*Elaboration) SetSemanticAccess added in v1.0.0

func (e *Elaboration) SetSemanticAccess(access ast.Access, semanticAccess Access)

func (*Elaboration) SetStaticCastTypes added in v0.30.0

func (e *Elaboration) SetStaticCastTypes(expression *ast.CastingExpression, types CastTypes)

func (*Elaboration) SetStringExpressionType added in v0.30.0

func (e *Elaboration) SetStringExpressionType(expression *ast.StringExpression, ty Type)

func (*Elaboration) SetSwapStatementTypes added in v0.30.0

func (e *Elaboration) SetSwapStatementTypes(statement *ast.SwapStatement, types SwapStatementTypes)

func (*Elaboration) SetTransactionDeclarationType added in v0.30.0

func (e *Elaboration) SetTransactionDeclarationType(declaration *ast.TransactionDeclaration, ty *TransactionType)

func (*Elaboration) SetVariableDeclarationTypes added in v0.30.0

func (e *Elaboration) SetVariableDeclarationTypes(
	declaration *ast.VariableDeclaration,
	types VariableDeclarationTypes,
)

func (*Elaboration) StaticCastTypes added in v0.25.0

func (e *Elaboration) StaticCastTypes(expression *ast.CastingExpression) (types CastTypes)

func (*Elaboration) StringExpressionType added in v0.24.0

func (e *Elaboration) StringExpressionType(expression *ast.StringExpression) Type

func (*Elaboration) SwapStatementTypes added in v0.26.0

func (e *Elaboration) SwapStatementTypes(statement *ast.SwapStatement) (types SwapStatementTypes)

func (*Elaboration) TransactionDeclarationType added in v0.30.0

func (e *Elaboration) TransactionDeclarationType(declaration *ast.TransactionDeclaration) *TransactionType

func (*Elaboration) VariableDeclarationTypes added in v0.26.0

func (e *Elaboration) VariableDeclarationTypes(declaration *ast.VariableDeclaration) (types VariableDeclarationTypes)

func (*Elaboration) VariableDeclarationTypesCount added in v0.30.0

func (e *Elaboration) VariableDeclarationTypesCount() int

type ElaborationImport added in v0.13.0

type ElaborationImport struct {
	Elaboration *Elaboration
}

ElaborationImport

func (ElaborationImport) AllTypeElements added in v0.13.0

func (i ElaborationImport) AllTypeElements() *StringImportElementOrderedMap

func (ElaborationImport) AllValueElements added in v0.13.0

func (i ElaborationImport) AllValueElements() *StringImportElementOrderedMap

func (ElaborationImport) IsChecking added in v0.13.0

func (i ElaborationImport) IsChecking() bool

type EmitDefaultDestroyEventError added in v1.0.0

type EmitDefaultDestroyEventError struct {
	ast.Range
}

func (*EmitDefaultDestroyEventError) Error added in v1.0.0

func (*EmitDefaultDestroyEventError) IsUserError added in v1.0.0

func (*EmitDefaultDestroyEventError) IsUserError()

type EmitImportedEventError

type EmitImportedEventError struct {
	Type Type
	ast.Range
}

func (*EmitImportedEventError) Error

func (e *EmitImportedEventError) Error() string

func (*EmitImportedEventError) IsUserError added in v0.25.0

func (*EmitImportedEventError) IsUserError()

type EmitNonEventError

type EmitNonEventError struct {
	Type Type
	ast.Range
}

func (*EmitNonEventError) Error

func (e *EmitNonEventError) Error() string

func (*EmitNonEventError) IsUserError added in v0.25.0

func (*EmitNonEventError) IsUserError()

type EndPositionGetter added in v0.24.0

type EndPositionGetter func(common.MemoryGauge) ast.Position

type EntitlementMapAccess added in v1.0.0

type EntitlementMapAccess struct {
	Type *EntitlementMapType
	// contains filtered or unexported fields
}

func NewEntitlementMapAccess added in v1.0.0

func NewEntitlementMapAccess(mapType *EntitlementMapType) *EntitlementMapAccess

func (*EntitlementMapAccess) Codomain added in v1.0.0

func (e *EntitlementMapAccess) Codomain() Access

func (*EntitlementMapAccess) Domain added in v1.0.0

func (*EntitlementMapAccess) Equal added in v1.0.0

func (e *EntitlementMapAccess) Equal(other Access) bool

func (*EntitlementMapAccess) ID added in v1.0.0

func (e *EntitlementMapAccess) ID() TypeID

func (*EntitlementMapAccess) Image added in v1.0.0

func (e *EntitlementMapAccess) Image(inputs Access, astRange func() ast.Range) (Access, error)

Image applies all the entitlements in the `argumentAccess` to the function defined by the map in `e`, producing a new entitlement set of the image of the arguments.

func (*EntitlementMapAccess) IsPrimitiveAccess added in v1.0.0

func (*EntitlementMapAccess) IsPrimitiveAccess() bool

func (*EntitlementMapAccess) PermitsAccess added in v1.0.0

func (e *EntitlementMapAccess) PermitsAccess(other Access) bool

func (*EntitlementMapAccess) QualifiedString added in v1.0.0

func (e *EntitlementMapAccess) QualifiedString() string

func (*EntitlementMapAccess) String added in v1.0.0

func (e *EntitlementMapAccess) String() string

type EntitlementMapType added in v1.0.0

type EntitlementMapType struct {
	Location common.Location

	Identifier string
	Relations  []EntitlementRelation

	// Whether this map type includes the special identity relation,
	// which maps every input to itself. The `Identity` mapping itself
	// is defined as the empty map type that includes the identity relation
	IncludesIdentity bool
	// contains filtered or unexported fields
}

func NewEntitlementMapType added in v1.0.0

func NewEntitlementMapType(
	memoryGauge common.MemoryGauge,
	location common.Location,
	identifier string,
) *EntitlementMapType

func (*EntitlementMapType) CheckInstantiated added in v1.0.0

func (t *EntitlementMapType) CheckInstantiated(_ ast.HasPosition, _ common.MemoryGauge, _ func(err error))

func (*EntitlementMapType) ContainFieldsOrElements added in v1.0.0

func (*EntitlementMapType) ContainFieldsOrElements() bool

func (*EntitlementMapType) Equal added in v1.0.0

func (t *EntitlementMapType) Equal(other Type) bool

func (*EntitlementMapType) GetContainerType added in v1.0.0

func (t *EntitlementMapType) GetContainerType() Type

func (*EntitlementMapType) GetLocation added in v1.0.0

func (t *EntitlementMapType) GetLocation() common.Location

func (*EntitlementMapType) GetMembers added in v1.0.0

func (t *EntitlementMapType) GetMembers() map[string]MemberResolver

func (*EntitlementMapType) ID added in v1.0.0

func (t *EntitlementMapType) ID() TypeID

func (*EntitlementMapType) IsComparable added in v1.0.0

func (*EntitlementMapType) IsComparable() bool

func (*EntitlementMapType) IsEquatable added in v1.0.0

func (*EntitlementMapType) IsEquatable() bool

func (*EntitlementMapType) IsExportable added in v1.0.0

func (*EntitlementMapType) IsExportable(_ map[*Member]bool) bool

func (*EntitlementMapType) IsImportable added in v1.0.0

func (*EntitlementMapType) IsImportable(_ map[*Member]bool) bool

func (*EntitlementMapType) IsInvalidType added in v1.0.0

func (*EntitlementMapType) IsInvalidType() bool

func (*EntitlementMapType) IsOrContainsReferenceType added in v1.0.0

func (*EntitlementMapType) IsOrContainsReferenceType() bool

func (*EntitlementMapType) IsPrimitiveType added in v1.0.0

func (*EntitlementMapType) IsPrimitiveType() bool

func (*EntitlementMapType) IsResourceType added in v1.0.0

func (*EntitlementMapType) IsResourceType() bool

func (*EntitlementMapType) IsStorable added in v1.0.0

func (*EntitlementMapType) IsStorable(_ map[*Member]bool) bool

func (*EntitlementMapType) IsType added in v1.0.0

func (*EntitlementMapType) IsType()

func (*EntitlementMapType) Map added in v1.0.0

func (*EntitlementMapType) QualifiedIdentifier added in v1.0.0

func (t *EntitlementMapType) QualifiedIdentifier() string

func (*EntitlementMapType) QualifiedString added in v1.0.0

func (t *EntitlementMapType) QualifiedString() string

func (*EntitlementMapType) Resolve added in v1.0.0

func (*EntitlementMapType) RewriteWithIntersectionTypes added in v1.0.0

func (t *EntitlementMapType) RewriteWithIntersectionTypes() (Type, bool)

func (*EntitlementMapType) SetContainerType added in v1.0.0

func (t *EntitlementMapType) SetContainerType(containerType Type)

func (*EntitlementMapType) String added in v1.0.0

func (t *EntitlementMapType) String() string

func (*EntitlementMapType) Tag added in v1.0.0

func (t *EntitlementMapType) Tag() TypeTag

func (*EntitlementMapType) TypeAnnotationState added in v1.0.0

func (*EntitlementMapType) TypeAnnotationState() TypeAnnotationState

func (*EntitlementMapType) Unify added in v1.0.0

type EntitlementOrderedSet added in v1.0.0

type EntitlementOrderedSet = orderedmap.OrderedMap[*EntitlementType, struct{}]

type EntitlementRelation added in v1.0.0

type EntitlementRelation struct {
	Input  *EntitlementType
	Output *EntitlementType
}

func NewEntitlementRelation added in v1.0.0

func NewEntitlementRelation(
	memoryGauge common.MemoryGauge,
	input *EntitlementType,
	output *EntitlementType,
) EntitlementRelation

type EntitlementSet added in v1.0.0

type EntitlementSet struct {
	// Entitlements is a set of entitlements
	Entitlements *EntitlementOrderedSet
	// Disjunctions is a set of entitlement disjunctions, keyed by disjunctionKey
	Disjunctions *DisjunctionOrderedSet
	// contains filtered or unexported fields
}

EntitlementSet is a set (conjunction) of entitlements and entitlement disjunctions. e.g. {entitlements: A, B; disjunctions: (C ∨ D), (E ∨ F)} This is distinct from an EntitlementSetAccess in Cadence, which is a program-level (and possibly non-minimal) approximation of this abstract set

func (*EntitlementSet) Access added in v1.0.0

func (s *EntitlementSet) Access() Access

Access returns the access represented by the entitlement set. The set is minimized before the access is computed. Note that this function may over-approximate the permissions required to represent this set of entitlements as an access modifier that Cadence can use, e.g. `(A ∨ B) ∧ C` cannot be represented in Cadence and will the produce an over-approximation of `(A, B, C)`

func (*EntitlementSet) Add added in v1.0.0

func (s *EntitlementSet) Add(entitlementType *EntitlementType)

Add adds an entitlement to the set.

NOTE: The resulting set is potentially not minimal: If the set contains a disjunction that contains the entitlement, then the disjunction is NOT discarded. Call Minimize to obtain a minimal set.

func (*EntitlementSet) AddDisjunction added in v1.0.0

func (s *EntitlementSet) AddDisjunction(disjunction *EntitlementOrderedSet)

AddDisjunction adds an entitlement disjunction to the set. If the set already contains an entitlement of the given disjunction, then the disjunction is discarded.

func (*EntitlementSet) IsMinimallyRepresentable added in v1.0.0

func (s *EntitlementSet) IsMinimallyRepresentable() bool

Returns whether this entitlement set is minimally representable in Cadence.

If true, this set can be exactly represented as a non-nested logical formula: i.e. either a single conjunction or a single disjunction If false, this set cannot be represented without nesting connective operators, and thus must be over-approximated when being represented in Cadence. As Cadence does not support nesting disjunctions and conjunctions in the same entitlement set, this function returns false when s.Entitlements and s.Disjunctions are both non-empty, or when s.Disjunctions has more than one element

func (*EntitlementSet) Merge added in v1.0.0

func (s *EntitlementSet) Merge(other *EntitlementSet)

Merge merges the other entitlement set into this set. The result is the union of the entitlements and disjunctions of both sets.

The result is not necessarily minimal: For example, if s contains a disjunction d, and other contains an entitlement e that is part of d, then the result will still contain d. See Add. Call Minimize to obtain a minimal set.

func (*EntitlementSet) Minimize added in v1.0.0

func (s *EntitlementSet) Minimize()

Minimize minimizes the entitlement set. It removes disjunctions that contain entitlements which are also in the entitlement set

type EntitlementSetAccess added in v1.0.0

type EntitlementSetAccess struct {
	Entitlements *EntitlementOrderedSet
	SetKind      EntitlementSetKind
	// contains filtered or unexported fields
}

func NewEntitlementSetAccess added in v1.0.0

func NewEntitlementSetAccess(
	entitlements []*EntitlementType,
	setKind EntitlementSetKind,
) EntitlementSetAccess

func (EntitlementSetAccess) Equal added in v1.0.0

func (e EntitlementSetAccess) Equal(other Access) bool

func (EntitlementSetAccess) ID added in v1.0.0

func (EntitlementSetAccess) IsPrimitiveAccess added in v1.0.0

func (EntitlementSetAccess) IsPrimitiveAccess() bool

func (EntitlementSetAccess) PermitsAccess added in v1.0.0

func (e EntitlementSetAccess) PermitsAccess(other Access) bool

func (EntitlementSetAccess) QualifiedString added in v1.0.0

func (e EntitlementSetAccess) QualifiedString() string

func (EntitlementSetAccess) String added in v1.0.0

func (e EntitlementSetAccess) String() string

type EntitlementSetKind added in v1.0.0

type EntitlementSetKind uint8
const (
	Conjunction EntitlementSetKind = iota
	Disjunction
)

type EntitlementSupportingType added in v1.0.0

type EntitlementSupportingType interface {
	Type
	SupportedEntitlements() *EntitlementSet
}

entitlement supporting types

type EntitlementType added in v1.0.0

type EntitlementType struct {
	Location common.Location

	Identifier string
	// contains filtered or unexported fields
}

func NewEntitlementType added in v1.0.0

func NewEntitlementType(memoryGauge common.MemoryGauge, location common.Location, identifier string) *EntitlementType

func (*EntitlementType) CheckInstantiated added in v1.0.0

func (t *EntitlementType) CheckInstantiated(_ ast.HasPosition, _ common.MemoryGauge, _ func(err error))

func (*EntitlementType) ContainFieldsOrElements added in v1.0.0

func (*EntitlementType) ContainFieldsOrElements() bool

func (*EntitlementType) Equal added in v1.0.0

func (t *EntitlementType) Equal(other Type) bool

func (*EntitlementType) GetContainerType added in v1.0.0

func (t *EntitlementType) GetContainerType() Type

func (*EntitlementType) GetLocation added in v1.0.0

func (t *EntitlementType) GetLocation() common.Location

func (*EntitlementType) GetMembers added in v1.0.0

func (t *EntitlementType) GetMembers() map[string]MemberResolver

func (*EntitlementType) ID added in v1.0.0

func (t *EntitlementType) ID() TypeID

func (*EntitlementType) IsComparable added in v1.0.0

func (*EntitlementType) IsComparable() bool

func (*EntitlementType) IsEquatable added in v1.0.0

func (*EntitlementType) IsEquatable() bool

func (*EntitlementType) IsExportable added in v1.0.0

func (*EntitlementType) IsExportable(_ map[*Member]bool) bool

func (*EntitlementType) IsImportable added in v1.0.0

func (*EntitlementType) IsImportable(_ map[*Member]bool) bool

func (*EntitlementType) IsInvalidType added in v1.0.0

func (t *EntitlementType) IsInvalidType() bool

func (*EntitlementType) IsOrContainsReferenceType added in v1.0.0

func (*EntitlementType) IsOrContainsReferenceType() bool

func (*EntitlementType) IsPrimitiveType added in v1.0.0

func (*EntitlementType) IsPrimitiveType() bool

func (*EntitlementType) IsResourceType added in v1.0.0

func (*EntitlementType) IsResourceType() bool

func (*EntitlementType) IsStorable added in v1.0.0

func (*EntitlementType) IsStorable(_ map[*Member]bool) bool

func (*EntitlementType) IsType added in v1.0.0

func (*EntitlementType) IsType()

func (*EntitlementType) Map added in v1.0.0

func (*EntitlementType) QualifiedIdentifier added in v1.0.0

func (t *EntitlementType) QualifiedIdentifier() string

func (*EntitlementType) QualifiedString added in v1.0.0

func (t *EntitlementType) QualifiedString() string

func (*EntitlementType) Resolve added in v1.0.0

func (*EntitlementType) RewriteWithIntersectionTypes added in v1.0.0

func (t *EntitlementType) RewriteWithIntersectionTypes() (Type, bool)

func (*EntitlementType) SetContainerType added in v1.0.0

func (t *EntitlementType) SetContainerType(containerType Type)

func (*EntitlementType) String added in v1.0.0

func (t *EntitlementType) String() string

func (*EntitlementType) Tag added in v1.0.0

func (t *EntitlementType) Tag() TypeTag

func (*EntitlementType) TypeAnnotationState added in v1.0.0

func (*EntitlementType) TypeAnnotationState() TypeAnnotationState

func (*EntitlementType) Unify added in v1.0.0

type EnumInfo added in v0.10.0

type EnumInfo struct {
	RawType Type
	Cases   []string
}

type ExcessiveArgumentsError added in v0.39.14

type ExcessiveArgumentsError struct {
	MaxCount    int
	ActualCount int
	ast.Range
}

func (*ExcessiveArgumentsError) Error added in v0.39.14

func (e *ExcessiveArgumentsError) Error() string

func (*ExcessiveArgumentsError) IsUserError added in v0.39.14

func (*ExcessiveArgumentsError) IsUserError()

func (*ExcessiveArgumentsError) SecondaryError added in v0.39.14

func (e *ExcessiveArgumentsError) SecondaryError() string

type ExpressionTypes added in v0.35.0

type ExpressionTypes struct {
	ActualType   Type
	ExpectedType Type
}

type FieldReinitializationError added in v0.24.0

type FieldReinitializationError struct {
	Name string
	ast.Range
}

FieldReinitializationError

func (*FieldReinitializationError) Error added in v0.24.0

func (*FieldReinitializationError) IsUserError added in v0.25.0

func (*FieldReinitializationError) IsUserError()

type FieldTypeNotStorableError added in v0.5.0

type FieldTypeNotStorableError struct {
	Type Type
	Name string
	Pos  ast.Position
}

func (*FieldTypeNotStorableError) EndPosition added in v0.10.0

func (e *FieldTypeNotStorableError) EndPosition(memoryGauge common.MemoryGauge) ast.Position

func (*FieldTypeNotStorableError) Error added in v0.5.0

func (e *FieldTypeNotStorableError) Error() string

func (*FieldTypeNotStorableError) IsUserError added in v0.25.0

func (*FieldTypeNotStorableError) IsUserError()

func (*FieldTypeNotStorableError) SecondaryError added in v0.31.0

func (e *FieldTypeNotStorableError) SecondaryError() string

func (*FieldTypeNotStorableError) StartPosition added in v0.10.0

func (e *FieldTypeNotStorableError) StartPosition() ast.Position

type FieldUninitializedError

type FieldUninitializedError struct {
	ContainerType Type
	Name          string
	Pos           ast.Position
}

FieldUninitializedError

func (*FieldUninitializedError) EndPosition

func (e *FieldUninitializedError) EndPosition(memoryGauge common.MemoryGauge) ast.Position

func (*FieldUninitializedError) Error

func (e *FieldUninitializedError) Error() string

func (*FieldUninitializedError) IsUserError added in v0.25.0

func (*FieldUninitializedError) IsUserError()

func (*FieldUninitializedError) SecondaryError

func (e *FieldUninitializedError) SecondaryError() string

func (*FieldUninitializedError) StartPosition

func (e *FieldUninitializedError) StartPosition() ast.Position

type FixedPointNumericType added in v0.15.0

type FixedPointNumericType struct {
	// contains filtered or unexported fields
}

FixedPointNumericType represents all the types in the fixed-point range.

func NewFixedPointNumericType added in v0.15.0

func NewFixedPointNumericType(typeName string) *FixedPointNumericType

func (*FixedPointNumericType) AsSuperType added in v0.24.0

func (t *FixedPointNumericType) AsSuperType() *FixedPointNumericType

func (*FixedPointNumericType) CheckInstantiated added in v1.0.0

func (*FixedPointNumericType) CheckInstantiated(_ ast.HasPosition, _ common.MemoryGauge, _ func(err error))

func (*FixedPointNumericType) ContainFieldsOrElements added in v1.0.0

func (t *FixedPointNumericType) ContainFieldsOrElements() bool

func (*FixedPointNumericType) Equal added in v0.15.0

func (t *FixedPointNumericType) Equal(other Type) bool

func (*FixedPointNumericType) GetMembers added in v0.15.0

func (t *FixedPointNumericType) GetMembers() map[string]MemberResolver

func (*FixedPointNumericType) ID added in v0.15.0

func (t *FixedPointNumericType) ID() TypeID

func (*FixedPointNumericType) IsComparable added in v0.39.0

func (t *FixedPointNumericType) IsComparable() bool

func (*FixedPointNumericType) IsEquatable added in v0.15.0

func (*FixedPointNumericType) IsEquatable() bool

func (*FixedPointNumericType) IsExportable added in v0.30.0

func (*FixedPointNumericType) IsExportable(_ map[*Member]bool) bool

func (*FixedPointNumericType) IsImportable added in v0.17.0

func (t *FixedPointNumericType) IsImportable(_ map[*Member]bool) bool

func (*FixedPointNumericType) IsInvalidType added in v0.15.0

func (*FixedPointNumericType) IsInvalidType() bool

func (*FixedPointNumericType) IsOrContainsReferenceType added in v1.0.0

func (*FixedPointNumericType) IsOrContainsReferenceType() bool

func (*FixedPointNumericType) IsPrimitiveType added in v1.0.0

func (*FixedPointNumericType) IsPrimitiveType() bool

func (*FixedPointNumericType) IsResourceType added in v0.15.0

func (*FixedPointNumericType) IsResourceType() bool

func (*FixedPointNumericType) IsStorable added in v0.15.0

func (*FixedPointNumericType) IsStorable(_ map[*Member]bool) bool

func (*FixedPointNumericType) IsSuperType added in v0.24.0

func (t *FixedPointNumericType) IsSuperType() bool

func (*FixedPointNumericType) IsType added in v0.15.0

func (*FixedPointNumericType) IsType()

func (*FixedPointNumericType) Map added in v1.0.0

func (*FixedPointNumericType) MaxFractional added in v0.15.0

func (t *FixedPointNumericType) MaxFractional() *big.Int

func (*FixedPointNumericType) MaxInt added in v0.15.0

func (t *FixedPointNumericType) MaxInt() *big.Int

func (*FixedPointNumericType) MinFractional added in v0.15.0

func (t *FixedPointNumericType) MinFractional() *big.Int

func (*FixedPointNumericType) MinInt added in v0.15.0

func (t *FixedPointNumericType) MinInt() *big.Int

func (*FixedPointNumericType) QualifiedString added in v0.15.0

func (t *FixedPointNumericType) QualifiedString() string

func (*FixedPointNumericType) Resolve added in v0.15.0

func (*FixedPointNumericType) RewriteWithIntersectionTypes added in v1.0.0

func (t *FixedPointNumericType) RewriteWithIntersectionTypes() (result Type, rewritten bool)

func (*FixedPointNumericType) Scale added in v0.15.0

func (t *FixedPointNumericType) Scale() uint

func (*FixedPointNumericType) String added in v0.15.0

func (t *FixedPointNumericType) String() string

func (*FixedPointNumericType) SupportsSaturatingAdd added in v0.15.0

func (t *FixedPointNumericType) SupportsSaturatingAdd() bool

func (*FixedPointNumericType) SupportsSaturatingDivide added in v0.15.0

func (t *FixedPointNumericType) SupportsSaturatingDivide() bool

func (*FixedPointNumericType) SupportsSaturatingMultiply added in v0.15.0

func (t *FixedPointNumericType) SupportsSaturatingMultiply() bool

func (*FixedPointNumericType) SupportsSaturatingSubtract added in v0.15.0

func (t *FixedPointNumericType) SupportsSaturatingSubtract() bool

func (*FixedPointNumericType) Tag added in v0.24.0

func (t *FixedPointNumericType) Tag() TypeTag

func (*FixedPointNumericType) TypeAnnotationState added in v0.15.0

func (*FixedPointNumericType) TypeAnnotationState() TypeAnnotationState

func (*FixedPointNumericType) Unify added in v0.15.0

func (*FixedPointNumericType) WithFractionalRange added in v0.15.0

func (t *FixedPointNumericType) WithFractionalRange(
	minFractional *big.Int,
	maxFractional *big.Int,
) *FixedPointNumericType

func (*FixedPointNumericType) WithIntRange added in v0.15.0

func (t *FixedPointNumericType) WithIntRange(minInt *big.Int, maxInt *big.Int) *FixedPointNumericType

func (*FixedPointNumericType) WithSaturatingFunctions added in v0.40.0

func (t *FixedPointNumericType) WithSaturatingFunctions(saturatingArithmetic SaturatingArithmeticSupport) *FixedPointNumericType

func (*FixedPointNumericType) WithScale added in v0.15.0

func (t *FixedPointNumericType) WithScale(scale uint) *FixedPointNumericType

func (*FixedPointNumericType) WithTag added in v0.24.0

type ForStatementTypes added in v1.0.0

type ForStatementTypes struct {
	IndexVariableType Type
	ValueVariableType Type
}

type FractionalRangedType

type FractionalRangedType interface {
	IntegerRangedType
	Scale() uint
	MinFractional() *big.Int
	MaxFractional() *big.Int
}

type FunctionActivation

type FunctionActivation struct {
	ReturnType           Type
	ReturnInfo           *ReturnInfo
	InitializationInfo   *InitializationInfo
	Loops                int
	Switches             int
	ValueActivationDepth int
}

func (FunctionActivation) InLoop

func (a FunctionActivation) InLoop() bool

func (FunctionActivation) InSwitch added in v0.10.0

func (a FunctionActivation) InSwitch() bool

func (*FunctionActivation) WithLoop added in v0.28.0

func (a *FunctionActivation) WithLoop(f func())

func (*FunctionActivation) WithSwitch added in v0.28.0

func (a *FunctionActivation) WithSwitch(f func())

type FunctionActivations

type FunctionActivations struct {
	// contains filtered or unexported fields
}

func (*FunctionActivations) Current

func (*FunctionActivations) EnterFunction

func (a *FunctionActivations) EnterFunction(functionType *FunctionType, valueActivationDepth int) *FunctionActivation

func (*FunctionActivations) IsLocal

func (a *FunctionActivations) IsLocal() bool

func (*FunctionActivations) LeaveFunction

func (a *FunctionActivations) LeaveFunction()

func (*FunctionActivations) WithFunction

func (a *FunctionActivations) WithFunction(
	functionType *FunctionType,
	valueActivationDepth int,
	f func(activation *FunctionActivation),
)

type FunctionExpressionInConditionError

type FunctionExpressionInConditionError struct {
	ast.Range
}

func (*FunctionExpressionInConditionError) Error

func (*FunctionExpressionInConditionError) IsUserError added in v0.25.0

func (*FunctionExpressionInConditionError) IsUserError()

type FunctionInvocation added in v0.17.0

type FunctionInvocation struct {
	FunctionType               *FunctionType
	TrailingSeparatorPositions []ast.Position
	StartPos                   Position
	EndPos                     Position
}

type FunctionInvocations added in v0.17.0

type FunctionInvocations struct {
	// contains filtered or unexported fields
}

func NewFunctionInvocations added in v0.17.0

func NewFunctionInvocations() *FunctionInvocations

func (*FunctionInvocations) Find added in v0.17.0

func (*FunctionInvocations) Put added in v0.17.0

func (f *FunctionInvocations) Put(
	startPos, endPos ast.Position,
	functionType *FunctionType,
	trailingSeparatorPositions []ast.Position,
)

type FunctionPurity added in v0.32.0

type FunctionPurity int

func PurityFromAnnotation added in v0.32.0

func PurityFromAnnotation(purity ast.FunctionPurity) FunctionPurity

func (FunctionPurity) String added in v0.32.0

func (p FunctionPurity) String() string

type FunctionType

type FunctionType struct {
	Purity                   FunctionPurity
	ReturnTypeAnnotation     TypeAnnotation
	Arity                    *Arity
	ArgumentExpressionsCheck ArgumentExpressionsCheck
	TypeArgumentsCheck       TypeArgumentsCheck
	Members                  *StringMemberOrderedMap
	TypeParameters           []*TypeParameter
	Parameters               []Parameter

	IsConstructor bool
	// contains filtered or unexported fields
}

func ArrayAppendAllFunctionType added in v0.20.0

func ArrayAppendAllFunctionType(arrayType Type) *FunctionType

func ArrayAppendFunctionType added in v0.20.0

func ArrayAppendFunctionType(elementType Type) *FunctionType

func ArrayConcatFunctionType added in v0.20.0

func ArrayConcatFunctionType(arrayType Type) *FunctionType

func ArrayContainsFunctionType added in v0.20.0

func ArrayContainsFunctionType(elementType Type) *FunctionType

func ArrayFilterFunctionType added in v0.41.0

func ArrayFilterFunctionType(memoryGauge common.MemoryGauge, elementType Type) *FunctionType

func ArrayFirstIndexFunctionType added in v0.24.0

func ArrayFirstIndexFunctionType(elementType Type) *FunctionType

func ArrayInsertFunctionType added in v0.20.0

func ArrayInsertFunctionType(elementType Type) *FunctionType

func ArrayMapFunctionType added in v0.41.0

func ArrayMapFunctionType(memoryGauge common.MemoryGauge, arrayType ArrayType) *FunctionType

func ArrayRemoveFirstFunctionType added in v0.20.0

func ArrayRemoveFirstFunctionType(elementType Type) *FunctionType

func ArrayRemoveFunctionType added in v0.20.0

func ArrayRemoveFunctionType(elementType Type) *FunctionType

func ArrayRemoveLastFunctionType added in v0.20.0

func ArrayRemoveLastFunctionType(elementType Type) *FunctionType

func ArrayReverseFunctionType added in v0.40.0

func ArrayReverseFunctionType(arrayType ArrayType) *FunctionType

func ArraySliceFunctionType added in v0.24.0

func ArraySliceFunctionType(elementType Type) *FunctionType

func ArrayToConstantSizedFunctionType added in v1.0.0

func ArrayToConstantSizedFunctionType(elementType Type) *FunctionType

func ArrayToVariableSizedFunctionType added in v1.0.0

func ArrayToVariableSizedFunctionType(elementType Type) *FunctionType

func CapabilityTypeBorrowFunctionType added in v0.20.0

func CapabilityTypeBorrowFunctionType(borrowType Type) *FunctionType

func CapabilityTypeCheckFunctionType added in v0.20.0

func CapabilityTypeCheckFunctionType(borrowType Type) *FunctionType

func CompositeForEachAttachmentFunctionType added in v1.0.0

func CompositeForEachAttachmentFunctionType(t common.CompositeKind) *FunctionType

func CompositeLikeConstructorType added in v0.36.0

func CompositeLikeConstructorType(
	elaboration *Elaboration,
	compositeDeclaration ast.CompositeLikeDeclaration,
	compositeType *CompositeType,
) (
	constructorFunctionType *FunctionType,
	argumentLabels []string,
)

func DictionaryContainsKeyFunctionType added in v0.20.0

func DictionaryContainsKeyFunctionType(t *DictionaryType) *FunctionType

func DictionaryForEachKeyFunctionType added in v0.27.1

func DictionaryForEachKeyFunctionType(t *DictionaryType) *FunctionType

func DictionaryInsertFunctionType added in v0.20.0

func DictionaryInsertFunctionType(t *DictionaryType) *FunctionType

func DictionaryRemoveFunctionType added in v0.20.0

func DictionaryRemoveFunctionType(t *DictionaryType) *FunctionType

func EnumConstructorType added in v0.20.0

func EnumConstructorType(compositeType *CompositeType) *FunctionType

func FromBigEndianBytesFunctionType added in v0.39.0

func FromBigEndianBytesFunctionType(ty Type) *FunctionType

func FromStringFunctionType added in v0.28.0

func FromStringFunctionType(ty Type) *FunctionType

func InclusiveRangeContainsFunctionType added in v1.0.0

func InclusiveRangeContainsFunctionType(elementType Type) *FunctionType

func NewSimpleFunctionType added in v0.32.0

func NewSimpleFunctionType(
	purity FunctionPurity,
	parameters []Parameter,
	returnTypeAnnotation TypeAnnotation,
) *FunctionType

func NumberConversionFunctionType added in v0.21.2

func NumberConversionFunctionType(numberType Type) *FunctionType

func OptionalTypeMapFunctionType added in v0.20.0

func OptionalTypeMapFunctionType(typ Type) *FunctionType

func (*FunctionType) ArgumentLabels

func (t *FunctionType) ArgumentLabels() (argumentLabels []string)

func (*FunctionType) CheckInstantiated added in v1.0.0

func (t *FunctionType) CheckInstantiated(pos ast.HasPosition, memoryGauge common.MemoryGauge, report func(err error))

func (*FunctionType) ContainFieldsOrElements added in v1.0.0

func (*FunctionType) ContainFieldsOrElements() bool

func (*FunctionType) Equal

func (t *FunctionType) Equal(other Type) bool

NOTE: parameter names and argument labels are intentionally *not* considered!

func (*FunctionType) GetMembers added in v0.7.0

func (t *FunctionType) GetMembers() map[string]MemberResolver

func (*FunctionType) HasSameArgumentLabels added in v0.7.0

func (t *FunctionType) HasSameArgumentLabels(other *FunctionType) bool

func (*FunctionType) ID

func (t *FunctionType) ID() TypeID

NOTE: parameter names and argument labels are *not* part of the ID!

func (*FunctionType) IsComparable added in v0.39.0

func (*FunctionType) IsComparable() bool

func (*FunctionType) IsEquatable added in v0.7.0

func (*FunctionType) IsEquatable() bool

func (*FunctionType) IsExportable added in v0.30.0

func (t *FunctionType) IsExportable(_ map[*Member]bool) bool

func (*FunctionType) IsImportable added in v0.17.0

func (t *FunctionType) IsImportable(_ map[*Member]bool) bool

func (*FunctionType) IsInvalidType

func (t *FunctionType) IsInvalidType() bool

func (*FunctionType) IsOrContainsReferenceType added in v1.0.0

func (*FunctionType) IsOrContainsReferenceType() bool

func (*FunctionType) IsPrimitiveType added in v1.0.0

func (t *FunctionType) IsPrimitiveType() bool

func (*FunctionType) IsResourceType

func (*FunctionType) IsResourceType() bool

func (*FunctionType) IsStorable added in v0.5.0

func (t *FunctionType) IsStorable(_ map[*Member]bool) bool

func (*FunctionType) IsType

func (*FunctionType) IsType()

func (*FunctionType) Map added in v1.0.0

func (t *FunctionType) Map(gauge common.MemoryGauge, typeParamMap map[*TypeParameter]*TypeParameter, f func(Type) Type) Type

func (*FunctionType) NamedQualifiedString added in v1.0.0

func (t *FunctionType) NamedQualifiedString(functionName string) string

func (*FunctionType) QualifiedString

func (t *FunctionType) QualifiedString() string

func (*FunctionType) Resolve

func (t *FunctionType) Resolve(typeArguments *TypeParameterTypeOrderedMap) Type

func (*FunctionType) RewriteWithIntersectionTypes added in v1.0.0

func (t *FunctionType) RewriteWithIntersectionTypes() (Type, bool)

func (*FunctionType) String

func (t *FunctionType) String() string

func (*FunctionType) Tag added in v0.24.0

func (t *FunctionType) Tag() TypeTag

func (*FunctionType) TypeAnnotationState

func (t *FunctionType) TypeAnnotationState() TypeAnnotationState

func (*FunctionType) Unify

func (t *FunctionType) Unify(
	other Type,
	typeParameters *TypeParameterTypeOrderedMap,
	report func(err error),
	memoryGauge common.MemoryGauge,
	outerRange ast.HasPosition,
) (
	result bool,
)

type GenericType

type GenericType struct {
	TypeParameter *TypeParameter
}

GenericType

func (*GenericType) CheckInstantiated added in v1.0.0

func (t *GenericType) CheckInstantiated(pos ast.HasPosition, memoryGauge common.MemoryGauge, report func(err error))

func (*GenericType) ContainFieldsOrElements added in v1.0.0

func (t *GenericType) ContainFieldsOrElements() bool

func (*GenericType) Equal

func (t *GenericType) Equal(other Type) bool

func (*GenericType) GetMembers added in v0.7.0

func (t *GenericType) GetMembers() map[string]MemberResolver

func (*GenericType) ID

func (t *GenericType) ID() TypeID

func (*GenericType) IsComparable added in v0.39.0

func (*GenericType) IsComparable() bool

func (*GenericType) IsEquatable added in v0.7.0

func (*GenericType) IsEquatable() bool

func (*GenericType) IsExportable added in v0.30.0

func (*GenericType) IsExportable(_ map[*Member]bool) bool

func (*GenericType) IsImportable added in v0.17.0

func (t *GenericType) IsImportable(_ map[*Member]bool) bool

func (*GenericType) IsInvalidType

func (*GenericType) IsInvalidType() bool

func (*GenericType) IsOrContainsReferenceType added in v1.0.0

func (*GenericType) IsOrContainsReferenceType() bool

func (*GenericType) IsPrimitiveType added in v1.0.0

func (*GenericType) IsPrimitiveType() bool

func (*GenericType) IsResourceType

func (*GenericType) IsResourceType() bool

func (*GenericType) IsStorable added in v0.5.0

func (*GenericType) IsStorable(_ map[*Member]bool) bool

func (*GenericType) IsType

func (*GenericType) IsType()

func (*GenericType) Map added in v1.0.0

func (t *GenericType) Map(_ common.MemoryGauge, typeParamMap map[*TypeParameter]*TypeParameter, f func(Type) Type) Type

func (*GenericType) QualifiedString

func (t *GenericType) QualifiedString() string

func (*GenericType) Resolve

func (t *GenericType) Resolve(typeArguments *TypeParameterTypeOrderedMap) Type

func (*GenericType) RewriteWithIntersectionTypes added in v1.0.0

func (t *GenericType) RewriteWithIntersectionTypes() (result Type, rewritten bool)

func (*GenericType) String

func (t *GenericType) String() string

func (*GenericType) Tag added in v0.24.0

func (t *GenericType) Tag() TypeTag

func (*GenericType) TypeAnnotationState

func (*GenericType) TypeAnnotationState() TypeAnnotationState

func (*GenericType) Unify

func (t *GenericType) Unify(
	other Type,
	typeParameters *TypeParameterTypeOrderedMap,
	report func(err error),
	memoryGauge common.MemoryGauge,
	outerRange ast.HasPosition,
) bool

type HashAlgorithm added in v0.14.0

type HashAlgorithm uint8
const (
	HashAlgorithmUnknown HashAlgorithm = iota
	HashAlgorithmSHA2_256
	HashAlgorithmSHA2_384
	HashAlgorithmSHA3_256
	HashAlgorithmSHA3_384
	HashAlgorithmKMAC128_BLS_BLS12_381
	HashAlgorithmKECCAK_256
)
  • Existing stored values use these raw values and should not change

NOTE: only add new algorithms, do *NOT* change existing items, reuse raw values for other items, swap the order, etc.

Existing stored values use these raw values and should not change

IMPORTANT: update HashAlgorithms AND HashAlgorithm.IsValid

func (HashAlgorithm) DocString added in v0.14.0

func (algo HashAlgorithm) DocString() string

func (HashAlgorithm) IsValid added in v0.30.0

func (algo HashAlgorithm) IsValid() bool

func (HashAlgorithm) Name added in v0.14.0

func (algo HashAlgorithm) Name() string

func (HashAlgorithm) RawValue added in v0.14.0

func (algo HashAlgorithm) RawValue() uint8

func (HashAlgorithm) String added in v0.14.0

func (i HashAlgorithm) String() string

type Import added in v0.5.0

type Import interface {
	AllValueElements() *StringImportElementOrderedMap
	AllTypeElements() *StringImportElementOrderedMap
	IsChecking() bool
}

type ImportElement added in v0.5.0

type ImportElement struct {
	Type            Type
	ArgumentLabels  []string
	DeclarationKind common.DeclarationKind
	Access          Access
}

ImportElement

type ImportHandlerFunc added in v0.5.0

type ImportHandlerFunc func(checker *Checker, importedLocation common.Location, importRange ast.Range) (Import, error)

type ImportedProgramError

type ImportedProgramError struct {
	Err      error
	Location common.Location
	ast.Range
}

func (*ImportedProgramError) ChildErrors

func (e *ImportedProgramError) ChildErrors() []error

func (*ImportedProgramError) Error

func (e *ImportedProgramError) Error() string

func (*ImportedProgramError) ImportLocation

func (e *ImportedProgramError) ImportLocation() common.Location

func (*ImportedProgramError) IsUserError added in v0.25.0

func (*ImportedProgramError) IsUserError()

func (*ImportedProgramError) Unwrap added in v0.32.0

func (e *ImportedProgramError) Unwrap() error

type InclusiveRangeType added in v1.0.0

type InclusiveRangeType struct {
	MemberType Type
	// contains filtered or unexported fields
}

func NewInclusiveRangeType added in v1.0.0

func NewInclusiveRangeType(memoryGauge common.MemoryGauge, elementType Type) *InclusiveRangeType

func (*InclusiveRangeType) AllowsValueIndexingAssignment added in v1.0.0

func (*InclusiveRangeType) AllowsValueIndexingAssignment() bool

func (*InclusiveRangeType) BaseType added in v1.0.0

func (t *InclusiveRangeType) BaseType() Type

func (*InclusiveRangeType) CheckInstantiated added in v1.0.0

func (t *InclusiveRangeType) CheckInstantiated(pos ast.HasPosition, memoryGauge common.MemoryGauge, report func(err error))

func (*InclusiveRangeType) ContainFieldsOrElements added in v1.0.0

func (t *InclusiveRangeType) ContainFieldsOrElements() bool

func (*InclusiveRangeType) Equal added in v1.0.0

func (t *InclusiveRangeType) Equal(other Type) bool

func (*InclusiveRangeType) GetMembers added in v1.0.0

func (t *InclusiveRangeType) GetMembers() map[string]MemberResolver

func (*InclusiveRangeType) ID added in v1.0.0

func (t *InclusiveRangeType) ID() TypeID

func (*InclusiveRangeType) Instantiate added in v1.0.0

func (t *InclusiveRangeType) Instantiate(
	memoryGauge common.MemoryGauge,
	typeArguments []Type,
	astTypeArguments []*ast.TypeAnnotation,
	report func(err error),
) Type

func (*InclusiveRangeType) IsComparable added in v1.0.0

func (*InclusiveRangeType) IsComparable() bool

func (*InclusiveRangeType) IsEquatable added in v1.0.0

func (t *InclusiveRangeType) IsEquatable() bool

func (*InclusiveRangeType) IsExportable added in v1.0.0

func (t *InclusiveRangeType) IsExportable(results map[*Member]bool) bool

func (*InclusiveRangeType) IsImportable added in v1.0.0

func (t *InclusiveRangeType) IsImportable(results map[*Member]bool) bool

func (*InclusiveRangeType) IsInvalidType added in v1.0.0

func (t *InclusiveRangeType) IsInvalidType() bool

func (*InclusiveRangeType) IsOrContainsReferenceType added in v1.0.0

func (t *InclusiveRangeType) IsOrContainsReferenceType() bool

func (*InclusiveRangeType) IsPrimitiveType added in v1.0.0

func (t *InclusiveRangeType) IsPrimitiveType() bool

func (*InclusiveRangeType) IsResourceType added in v1.0.0

func (*InclusiveRangeType) IsResourceType() bool

func (*InclusiveRangeType) IsStorable added in v1.0.0

func (*InclusiveRangeType) IsStorable(_ map[*Member]bool) bool

func (*InclusiveRangeType) IsType added in v1.0.0

func (*InclusiveRangeType) IsType()

func (*InclusiveRangeType) Map added in v1.0.0

func (t *InclusiveRangeType) Map(
	gauge common.MemoryGauge,
	typeParamMap map[*TypeParameter]*TypeParameter,
	f func(Type) Type,
) Type

func (*InclusiveRangeType) QualifiedString added in v1.0.0

func (t *InclusiveRangeType) QualifiedString() string

func (*InclusiveRangeType) Resolve added in v1.0.0

func (t *InclusiveRangeType) Resolve(typeArguments *TypeParameterTypeOrderedMap) Type

func (*InclusiveRangeType) RewriteWithIntersectionTypes added in v1.0.0

func (t *InclusiveRangeType) RewriteWithIntersectionTypes() (Type, bool)

func (*InclusiveRangeType) String added in v1.0.0

func (t *InclusiveRangeType) String() string

func (*InclusiveRangeType) Tag added in v1.0.0

func (*InclusiveRangeType) Tag() TypeTag

func (*InclusiveRangeType) TypeAnnotationState added in v1.0.0

func (t *InclusiveRangeType) TypeAnnotationState() TypeAnnotationState

func (*InclusiveRangeType) TypeArguments added in v1.0.0

func (t *InclusiveRangeType) TypeArguments() []Type

func (*InclusiveRangeType) TypeParameters added in v1.0.0

func (*InclusiveRangeType) TypeParameters() []*TypeParameter

func (*InclusiveRangeType) Unify added in v1.0.0

func (t *InclusiveRangeType) Unify(
	other Type,
	typeParameters *TypeParameterTypeOrderedMap,
	report func(err error),
	memoryGauge common.MemoryGauge,
	outerRange ast.HasPosition,
) bool

type IncorrectArgumentLabelError

type IncorrectArgumentLabelError struct {
	ExpectedArgumentLabel string
	ActualArgumentLabel   string
	ast.Range
}

func (*IncorrectArgumentLabelError) Error

func (*IncorrectArgumentLabelError) IsUserError added in v0.25.0

func (*IncorrectArgumentLabelError) IsUserError()

func (*IncorrectArgumentLabelError) SecondaryError

func (e *IncorrectArgumentLabelError) SecondaryError() string

func (*IncorrectArgumentLabelError) SuggestFixes added in v0.40.0

type IncorrectTransferOperationError

type IncorrectTransferOperationError struct {
	ActualOperation   ast.TransferOperation
	ExpectedOperation ast.TransferOperation
	ast.Range
}

func (*IncorrectTransferOperationError) Error

func (*IncorrectTransferOperationError) IsUserError added in v0.25.0

func (*IncorrectTransferOperationError) IsUserError()

func (*IncorrectTransferOperationError) SecondaryError

func (e *IncorrectTransferOperationError) SecondaryError() string

type IndexExpressionTypes added in v0.26.0

type IndexExpressionTypes struct {
	IndexedType     ValueIndexableType
	IndexingType    Type
	ResultType      Type
	ReturnReference bool
}

type InitializationInfo

type InitializationInfo struct {
	ContainerType           Type
	FieldMembers            *MemberFieldDeclarationOrderedMap
	InitializedFieldMembers *persistent.OrderedSet[*Member]
}

func NewInitializationInfo

func NewInitializationInfo(
	containerType Type,
	fieldMembers *MemberFieldDeclarationOrderedMap,
) *InitializationInfo

func (*InitializationInfo) InitializationComplete

func (info *InitializationInfo) InitializationComplete() bool

InitializationComplete returns true if all fields of the container were initialized, false if some fields are uninitialized

type InitializerMismatch

type InitializerMismatch struct {
	CompositePurity     FunctionPurity
	InterfacePurity     FunctionPurity
	CompositeParameters []Parameter
	InterfaceParameters []Parameter
}

type InsufficientArgumentsError added in v0.39.14

type InsufficientArgumentsError struct {
	MinCount    int
	ActualCount int
	ast.Range
}

func (*InsufficientArgumentsError) Error added in v0.39.14

func (*InsufficientArgumentsError) IsUserError added in v0.39.14

func (*InsufficientArgumentsError) IsUserError()

func (*InsufficientArgumentsError) SecondaryError added in v0.39.14

func (e *InsufficientArgumentsError) SecondaryError() string

type IntegerRangedType

type IntegerRangedType interface {
	Type
	MinInt() *big.Int
	MaxInt() *big.Int
	IsSuperType() bool
}

type InterfaceMemberConflictError added in v1.0.0

type InterfaceMemberConflictError struct {
	InterfaceType            *InterfaceType
	ConflictingInterfaceType *InterfaceType
	MemberName               string
	MemberKind               common.DeclarationKind
	ConflictingMemberKind    common.DeclarationKind
	ast.Range
}

InterfaceMemberConflictError

func (*InterfaceMemberConflictError) Error added in v1.0.0

func (*InterfaceMemberConflictError) IsUserError added in v1.0.0

func (*InterfaceMemberConflictError) IsUserError()

type InterfaceSet

type InterfaceSet orderedmap.OrderedMap[*InterfaceType, struct{}]

func NewInterfaceSet added in v0.13.0

func NewInterfaceSet() *InterfaceSet

func (*InterfaceSet) Add added in v0.3.0

func (s *InterfaceSet) Add(interfaceType *InterfaceType)

func (InterfaceSet) Contains added in v0.28.0

func (s InterfaceSet) Contains(interfaceType *InterfaceType) bool

func (InterfaceSet) ForEach added in v0.13.0

func (s InterfaceSet) ForEach(f func(*InterfaceType))

func (InterfaceSet) IsSubsetOf

func (s InterfaceSet) IsSubsetOf(other *InterfaceSet) bool

func (InterfaceSet) Len added in v0.13.0

func (s InterfaceSet) Len() int

type InterfaceType

type InterfaceType struct {
	Location common.Location

	Members *StringMemberOrderedMap

	NestedTypes *StringTypeOrderedMap

	Identifier            string
	Fields                []string
	InitializerParameters []Parameter
	CompositeKind         common.CompositeKind

	InitializerPurity FunctionPurity

	ExplicitInterfaceConformances []*InterfaceType

	DefaultDestroyEvent *CompositeType
	// contains filtered or unexported fields
}

func (*InterfaceType) CheckInstantiated added in v1.0.0

func (t *InterfaceType) CheckInstantiated(pos ast.HasPosition, memoryGauge common.MemoryGauge, report func(err error))

func (*InterfaceType) ContainFieldsOrElements added in v1.0.0

func (*InterfaceType) ContainFieldsOrElements() bool

func (*InterfaceType) EffectiveInterfaceConformanceSet added in v1.0.0

func (t *InterfaceType) EffectiveInterfaceConformanceSet() *InterfaceSet

func (*InterfaceType) EffectiveInterfaceConformances added in v1.0.0

func (t *InterfaceType) EffectiveInterfaceConformances() []Conformance

func (*InterfaceType) Equal

func (t *InterfaceType) Equal(other Type) bool

func (*InterfaceType) FieldPosition added in v0.21.3

func (t *InterfaceType) FieldPosition(name string, declaration *ast.InterfaceDeclaration) ast.Position

func (*InterfaceType) GetCompositeKind

func (t *InterfaceType) GetCompositeKind() common.CompositeKind

func (*InterfaceType) GetContainerType

func (t *InterfaceType) GetContainerType() Type

func (*InterfaceType) GetLocation

func (t *InterfaceType) GetLocation() common.Location

func (*InterfaceType) GetMembers added in v0.7.0

func (t *InterfaceType) GetMembers() map[string]MemberResolver

func (*InterfaceType) GetNestedTypes added in v0.13.2

func (t *InterfaceType) GetNestedTypes() *StringTypeOrderedMap

func (*InterfaceType) ID

func (t *InterfaceType) ID() TypeID

func (*InterfaceType) IsComparable added in v0.39.0

func (*InterfaceType) IsComparable() bool

func (*InterfaceType) IsContainerType added in v0.20.3

func (t *InterfaceType) IsContainerType() bool

func (*InterfaceType) IsEquatable added in v0.7.0

func (*InterfaceType) IsEquatable() bool

func (*InterfaceType) IsExportable added in v0.30.0

func (t *InterfaceType) IsExportable(results map[*Member]bool) bool

func (*InterfaceType) IsImportable added in v0.17.0

func (t *InterfaceType) IsImportable(results map[*Member]bool) bool

func (*InterfaceType) IsInvalidType

func (*InterfaceType) IsInvalidType() bool

func (*InterfaceType) IsOrContainsReferenceType added in v1.0.0

func (*InterfaceType) IsOrContainsReferenceType() bool

func (*InterfaceType) IsPrimitiveType added in v1.0.0

func (*InterfaceType) IsPrimitiveType() bool

func (*InterfaceType) IsResourceType

func (t *InterfaceType) IsResourceType() bool

func (*InterfaceType) IsStorable added in v0.5.0

func (t *InterfaceType) IsStorable(results map[*Member]bool) bool

func (*InterfaceType) IsType

func (*InterfaceType) IsType()

func (*InterfaceType) Map added in v1.0.0

func (*InterfaceType) MemberMap added in v0.32.0

func (t *InterfaceType) MemberMap() *StringMemberOrderedMap

func (*InterfaceType) QualifiedIdentifier

func (t *InterfaceType) QualifiedIdentifier() string

func (*InterfaceType) QualifiedString

func (t *InterfaceType) QualifiedString() string

func (*InterfaceType) Resolve

func (*InterfaceType) RewriteWithIntersectionTypes added in v1.0.0

func (t *InterfaceType) RewriteWithIntersectionTypes() (Type, bool)

func (*InterfaceType) SetContainerType added in v0.17.0

func (t *InterfaceType) SetContainerType(containerType Type)

func (*InterfaceType) String

func (t *InterfaceType) String() string

func (*InterfaceType) SupportedEntitlements added in v1.0.0

func (t *InterfaceType) SupportedEntitlements() *EntitlementSet

func (*InterfaceType) Tag added in v0.24.0

func (t *InterfaceType) Tag() TypeTag

func (*InterfaceType) TypeAnnotationState

func (*InterfaceType) TypeAnnotationState() TypeAnnotationState

func (*InterfaceType) Unify

type IntersectionCompositeKindMismatchError added in v1.0.0

type IntersectionCompositeKindMismatchError struct {
	CompositeKind         common.CompositeKind
	PreviousCompositeKind common.CompositeKind
	ast.Range
}

func (*IntersectionCompositeKindMismatchError) Error added in v1.0.0

func (*IntersectionCompositeKindMismatchError) IsUserError added in v1.0.0

type IntersectionMemberClashError added in v1.0.0

type IntersectionMemberClashError struct {
	RedeclaringType       *InterfaceType
	OriginalDeclaringType *InterfaceType
	Name                  string
	ast.Range
}

func (*IntersectionMemberClashError) Error added in v1.0.0

func (*IntersectionMemberClashError) IsUserError added in v1.0.0

func (*IntersectionMemberClashError) IsUserError()

type IntersectionType added in v1.0.0

type IntersectionType struct {
	Types []*InterfaceType

	// Deprecated
	LegacyType Type
	// contains filtered or unexported fields
}

func NewIntersectionType added in v1.0.0

func NewIntersectionType(memoryGauge common.MemoryGauge, legacyType Type, types []*InterfaceType) *IntersectionType

TODO: remove `legacyType` once all uses of it are removed

func (*IntersectionType) CheckInstantiated added in v1.0.0

func (t *IntersectionType) CheckInstantiated(_ ast.HasPosition, _ common.MemoryGauge, _ func(err error))

func (*IntersectionType) ContainFieldsOrElements added in v1.0.0

func (*IntersectionType) ContainFieldsOrElements() bool

func (*IntersectionType) EffectiveIntersectionSet added in v1.0.0

func (t *IntersectionType) EffectiveIntersectionSet() *InterfaceSet

func (*IntersectionType) Equal added in v1.0.0

func (t *IntersectionType) Equal(other Type) bool

func (*IntersectionType) GetMembers added in v1.0.0

func (t *IntersectionType) GetMembers() map[string]MemberResolver

func (*IntersectionType) ID added in v1.0.0

func (t *IntersectionType) ID() TypeID

func (*IntersectionType) IsComparable added in v1.0.0

func (t *IntersectionType) IsComparable() bool

func (*IntersectionType) IsEquatable added in v1.0.0

func (*IntersectionType) IsEquatable() bool

func (*IntersectionType) IsExportable added in v1.0.0

func (t *IntersectionType) IsExportable(results map[*Member]bool) bool

func (*IntersectionType) IsImportable added in v1.0.0

func (t *IntersectionType) IsImportable(results map[*Member]bool) bool

func (*IntersectionType) IsInvalidType added in v1.0.0

func (t *IntersectionType) IsInvalidType() bool

func (*IntersectionType) IsOrContainsReferenceType added in v1.0.0

func (t *IntersectionType) IsOrContainsReferenceType() bool

func (*IntersectionType) IsPrimitiveType added in v1.0.0

func (*IntersectionType) IsPrimitiveType() bool

func (*IntersectionType) IsResourceType added in v1.0.0

func (t *IntersectionType) IsResourceType() bool

func (*IntersectionType) IsStorable added in v1.0.0

func (t *IntersectionType) IsStorable(results map[*Member]bool) bool

func (*IntersectionType) IsType added in v1.0.0

func (*IntersectionType) IsType()

func (*IntersectionType) IsValidIndexingType added in v1.0.0

func (t *IntersectionType) IsValidIndexingType(ty Type) bool

func (*IntersectionType) Map added in v1.0.0

func (t *IntersectionType) Map(gauge common.MemoryGauge, typeParamMap map[*TypeParameter]*TypeParameter, f func(Type) Type) Type

func (*IntersectionType) QualifiedString added in v1.0.0

func (t *IntersectionType) QualifiedString() string

func (*IntersectionType) Resolve added in v1.0.0

func (*IntersectionType) RewriteWithIntersectionTypes added in v1.0.0

func (t *IntersectionType) RewriteWithIntersectionTypes() (Type, bool)

func (*IntersectionType) String added in v1.0.0

func (t *IntersectionType) String() string

func (*IntersectionType) SupportedEntitlements added in v1.0.0

func (t *IntersectionType) SupportedEntitlements() *EntitlementSet

func (*IntersectionType) Tag added in v1.0.0

func (t *IntersectionType) Tag() TypeTag

func (*IntersectionType) TypeAnnotationState added in v1.0.0

func (*IntersectionType) TypeAnnotationState() TypeAnnotationState

func (*IntersectionType) TypeIndexingElementType added in v1.0.0

func (t *IntersectionType) TypeIndexingElementType(indexingType Type, _ func() ast.Range) (Type, error)

func (*IntersectionType) Unify added in v1.0.0

type InvalidAccessError

type InvalidAccessError struct {
	Name              string
	RestrictingAccess Access
	PossessedAccess   Access
	DeclarationKind   common.DeclarationKind

	ast.Range
	// contains filtered or unexported fields
}

func (*InvalidAccessError) Error

func (e *InvalidAccessError) Error() string

func (*InvalidAccessError) IsUserError added in v0.25.0

func (*InvalidAccessError) IsUserError()

func (*InvalidAccessError) SecondaryError added in v1.0.0

func (e *InvalidAccessError) SecondaryError() string

When e.PossessedAccess is a conjunctive entitlement set, we can suggest which additional entitlements it would need to be given in order to have e.RequiredAccess.

type InvalidAccessModifierError

type InvalidAccessModifierError struct {
	Explanation     string
	Pos             ast.Position
	DeclarationKind common.DeclarationKind
	Access          Access
}

func (*InvalidAccessModifierError) EndPosition

func (e *InvalidAccessModifierError) EndPosition(memoryGauge common.MemoryGauge) ast.Position

func (*InvalidAccessModifierError) Error

func (*InvalidAccessModifierError) IsUserError added in v0.25.0

func (*InvalidAccessModifierError) IsUserError()

func (*InvalidAccessModifierError) StartPosition

func (e *InvalidAccessModifierError) StartPosition() ast.Position

type InvalidAddressLiteralError

type InvalidAddressLiteralError struct {
	ast.Range
}

func (*InvalidAddressLiteralError) Error

func (*InvalidAddressLiteralError) IsUserError added in v0.25.0

func (*InvalidAddressLiteralError) IsUserError()

type InvalidAssignmentAccessError

type InvalidAssignmentAccessError struct {
	Name              string
	ContainerType     Type
	RestrictingAccess Access
	DeclarationKind   common.DeclarationKind
	ast.Range
}

func (*InvalidAssignmentAccessError) Error

func (*InvalidAssignmentAccessError) IsUserError added in v0.25.0

func (*InvalidAssignmentAccessError) IsUserError()

func (*InvalidAssignmentAccessError) SecondaryError

func (e *InvalidAssignmentAccessError) SecondaryError() string

type InvalidAssignmentTargetError

type InvalidAssignmentTargetError struct {
	ast.Range
}

func (*InvalidAssignmentTargetError) Error

func (*InvalidAssignmentTargetError) IsUserError added in v0.25.0

func (*InvalidAssignmentTargetError) IsUserError()

type InvalidAttachmentAnnotationError added in v0.36.0

type InvalidAttachmentAnnotationError struct {
	ast.Range
}

func (*InvalidAttachmentAnnotationError) Error added in v0.36.0

func (*InvalidAttachmentAnnotationError) IsUserError added in v0.36.0

func (*InvalidAttachmentAnnotationError) IsUserError()

type InvalidAttachmentEntitlementError added in v1.0.0

type InvalidAttachmentEntitlementError struct {
	Attachment         *CompositeType
	BaseType           Type
	InvalidEntitlement *EntitlementType
	Pos                ast.Position
}

InvalidAttachmentEntitlementError

func (*InvalidAttachmentEntitlementError) EndPosition added in v1.0.0

func (*InvalidAttachmentEntitlementError) Error added in v1.0.0

func (*InvalidAttachmentEntitlementError) IsUserError added in v1.0.0

func (*InvalidAttachmentEntitlementError) IsUserError()

func (*InvalidAttachmentEntitlementError) SecondaryError added in v1.0.0

func (e *InvalidAttachmentEntitlementError) SecondaryError() string

func (*InvalidAttachmentEntitlementError) StartPosition added in v1.0.0

func (e *InvalidAttachmentEntitlementError) StartPosition() ast.Position

type InvalidAttachmentMappedEntitlementMemberError added in v1.0.0

type InvalidAttachmentMappedEntitlementMemberError struct {
	Pos ast.Position
}

InvalidAttachmentMappedEntitlementMemberError

func (*InvalidAttachmentMappedEntitlementMemberError) EndPosition added in v1.0.0

func (*InvalidAttachmentMappedEntitlementMemberError) Error added in v1.0.0

func (*InvalidAttachmentMappedEntitlementMemberError) IsUserError added in v1.0.0

func (*InvalidAttachmentMappedEntitlementMemberError) StartPosition added in v1.0.0

type InvalidAttachmentRemoveError added in v0.36.0

type InvalidAttachmentRemoveError struct {
	Attachment Type
	BaseType   Type
	ast.Range
}

InvalidAttachmentRemoveError

func (*InvalidAttachmentRemoveError) Error added in v0.36.0

func (*InvalidAttachmentRemoveError) IsUserError added in v0.36.0

func (*InvalidAttachmentRemoveError) IsUserError()

type InvalidAttachmentUsageError added in v0.36.0

type InvalidAttachmentUsageError struct {
	ast.Range
}

func (*InvalidAttachmentUsageError) Error added in v0.36.0

func (*InvalidAttachmentUsageError) IsUserError added in v0.36.0

func (*InvalidAttachmentUsageError) IsUserError()

type InvalidBaseTypeError added in v0.36.0

type InvalidBaseTypeError struct {
	BaseType   Type
	Attachment *CompositeType
	ast.Range
}

func (*InvalidBaseTypeError) Error added in v0.36.0

func (e *InvalidBaseTypeError) Error() string

func (*InvalidBaseTypeError) IsUserError added in v0.36.0

func (*InvalidBaseTypeError) IsUserError()

type InvalidBinaryOperandError

type InvalidBinaryOperandError struct {
	ExpectedType Type
	ActualType   Type
	ast.Range
	Operation ast.Operation
	Side      common.OperandSide
}

func (*InvalidBinaryOperandError) Error

func (e *InvalidBinaryOperandError) Error() string

func (*InvalidBinaryOperandError) IsUserError added in v0.25.0

func (*InvalidBinaryOperandError) IsUserError()

func (*InvalidBinaryOperandError) SecondaryError

func (e *InvalidBinaryOperandError) SecondaryError() string

type InvalidBinaryOperandsError

type InvalidBinaryOperandsError struct {
	LeftType  Type
	RightType Type
	ast.Range
	Operation ast.Operation
}

func (*InvalidBinaryOperandsError) Error

func (*InvalidBinaryOperandsError) IsUserError added in v0.25.0

func (*InvalidBinaryOperandsError) IsUserError()

type InvalidCharacterLiteralError

type InvalidCharacterLiteralError struct {
	Length int
	ast.Range
}

func (*InvalidCharacterLiteralError) Error

func (*InvalidCharacterLiteralError) IsUserError added in v0.25.0

func (*InvalidCharacterLiteralError) IsUserError()

func (*InvalidCharacterLiteralError) SecondaryError

func (e *InvalidCharacterLiteralError) SecondaryError() string

type InvalidConditionalResourceOperandError added in v0.21.3

type InvalidConditionalResourceOperandError struct {
	ast.Range
}

func (*InvalidConditionalResourceOperandError) Error added in v0.21.3

type InvalidConformanceError

type InvalidConformanceError struct {
	Type Type
	ast.Range
}

func (*InvalidConformanceError) Error

func (e *InvalidConformanceError) Error() string

func (*InvalidConformanceError) IsUserError added in v0.25.0

func (*InvalidConformanceError) IsUserError()

type InvalidConstantSizedTypeBaseError

type InvalidConstantSizedTypeBaseError struct {
	ActualBase   int
	ExpectedBase int
	ast.Range
}

func (*InvalidConstantSizedTypeBaseError) Error

func (*InvalidConstantSizedTypeBaseError) IsUserError added in v0.25.0

func (*InvalidConstantSizedTypeBaseError) IsUserError()

func (*InvalidConstantSizedTypeBaseError) SecondaryError

func (e *InvalidConstantSizedTypeBaseError) SecondaryError() string

type InvalidConstantSizedTypeSizeError

type InvalidConstantSizedTypeSizeError struct {
	ActualSize     *big.Int
	ExpectedMinInt *big.Int
	ExpectedMaxInt *big.Int
	ast.Range
}

func (*InvalidConstantSizedTypeSizeError) Error

func (*InvalidConstantSizedTypeSizeError) IsUserError added in v0.25.0

func (*InvalidConstantSizedTypeSizeError) IsUserError()

func (*InvalidConstantSizedTypeSizeError) SecondaryError

func (e *InvalidConstantSizedTypeSizeError) SecondaryError() string

type InvalidConstructionError

type InvalidConstructionError struct {
	ast.Range
}

func (*InvalidConstructionError) Error

func (e *InvalidConstructionError) Error() string

func (*InvalidConstructionError) IsUserError added in v0.25.0

func (*InvalidConstructionError) IsUserError()

type InvalidDeclarationError

type InvalidDeclarationError struct {
	Identifier string
	Kind       common.DeclarationKind
	ast.Range
}

func (*InvalidDeclarationError) Error

func (e *InvalidDeclarationError) Error() string

func (*InvalidDeclarationError) IsUserError added in v0.25.0

func (*InvalidDeclarationError) IsUserError()

type InvalidDestructionError

type InvalidDestructionError struct {
	ast.Range
}

func (*InvalidDestructionError) Error

func (e *InvalidDestructionError) Error() string

func (*InvalidDestructionError) IsUserError added in v0.25.0

func (*InvalidDestructionError) IsUserError()

type InvalidDictionaryKeyTypeError

type InvalidDictionaryKeyTypeError struct {
	Type Type
	ast.Range
}

func (*InvalidDictionaryKeyTypeError) Error

func (*InvalidDictionaryKeyTypeError) IsUserError added in v0.25.0

func (*InvalidDictionaryKeyTypeError) IsUserError()

type InvalidEmitConditionError added in v1.0.0

type InvalidEmitConditionError struct {
	ast.Range
}

func (*InvalidEmitConditionError) Error added in v1.0.0

func (e *InvalidEmitConditionError) Error() string

func (*InvalidEmitConditionError) IsUserError added in v1.0.0

func (*InvalidEmitConditionError) IsUserError()

type InvalidEntitlementAccessError added in v1.0.0

type InvalidEntitlementAccessError struct {
	Pos ast.Position
}

InvalidEntitlementAccessError

func (*InvalidEntitlementAccessError) EndPosition added in v1.0.0

func (*InvalidEntitlementAccessError) Error added in v1.0.0

func (*InvalidEntitlementAccessError) IsUserError added in v1.0.0

func (*InvalidEntitlementAccessError) IsUserError()

func (*InvalidEntitlementAccessError) StartPosition added in v1.0.0

func (e *InvalidEntitlementAccessError) StartPosition() ast.Position

type InvalidEntitlementMappingInclusionError added in v1.0.0

type InvalidEntitlementMappingInclusionError struct {
	Map          *EntitlementMapType
	IncludedType Type
	ast.Range
}

InvalidEntitlementMappingInclusionError

func (*InvalidEntitlementMappingInclusionError) Error added in v1.0.0

func (*InvalidEntitlementMappingInclusionError) IsUserError added in v1.0.0

type InvalidEntitlementMappingTypeError added in v1.0.0

type InvalidEntitlementMappingTypeError struct {
	Type Type
	Pos  ast.Position
}

InvalidEntitlementMappingTypeError

func (*InvalidEntitlementMappingTypeError) EndPosition added in v1.0.0

func (*InvalidEntitlementMappingTypeError) Error added in v1.0.0

func (*InvalidEntitlementMappingTypeError) IsUserError added in v1.0.0

func (*InvalidEntitlementMappingTypeError) IsUserError()

func (*InvalidEntitlementMappingTypeError) SecondaryError added in v1.0.0

func (e *InvalidEntitlementMappingTypeError) SecondaryError() string

func (*InvalidEntitlementMappingTypeError) StartPosition added in v1.0.0

func (e *InvalidEntitlementMappingTypeError) StartPosition() ast.Position

type InvalidEntryPointTypeError added in v0.11.0

type InvalidEntryPointTypeError struct {
	Type Type
}

func (*InvalidEntryPointTypeError) Error added in v0.11.0

func (*InvalidEntryPointTypeError) IsUserError added in v0.25.0

func (*InvalidEntryPointTypeError) IsUserError()

type InvalidEnumCaseError added in v0.10.0

type InvalidEnumCaseError struct {
	ContainerDeclarationKind common.DeclarationKind
	ast.Range
}

func (*InvalidEnumCaseError) Error added in v0.10.0

func (e *InvalidEnumCaseError) Error() string

func (*InvalidEnumCaseError) IsUserError added in v0.25.0

func (*InvalidEnumCaseError) IsUserError()

type InvalidEnumConformancesError added in v0.10.0

type InvalidEnumConformancesError struct {
	ast.Range
}

func (*InvalidEnumConformancesError) Error added in v0.10.0

func (*InvalidEnumConformancesError) IsUserError added in v0.25.0

func (*InvalidEnumConformancesError) IsUserError()

type InvalidEnumRawTypeError added in v0.10.0

type InvalidEnumRawTypeError struct {
	Type Type
	ast.Range
}

func (*InvalidEnumRawTypeError) Error added in v0.10.0

func (e *InvalidEnumRawTypeError) Error() string

func (*InvalidEnumRawTypeError) IsUserError added in v0.25.0

func (*InvalidEnumRawTypeError) IsUserError()

func (*InvalidEnumRawTypeError) SecondaryError added in v0.31.0

func (e *InvalidEnumRawTypeError) SecondaryError() string

type InvalidEventParameterTypeError

type InvalidEventParameterTypeError struct {
	Type Type
	ast.Range
}

func (*InvalidEventParameterTypeError) Error

func (*InvalidEventParameterTypeError) IsUserError added in v0.25.0

func (*InvalidEventParameterTypeError) IsUserError()

type InvalidEventUsageError

type InvalidEventUsageError struct {
	ast.Range
}

func (*InvalidEventUsageError) Error

func (e *InvalidEventUsageError) Error() string

func (*InvalidEventUsageError) IsUserError added in v0.25.0

func (*InvalidEventUsageError) IsUserError()

type InvalidFailableResourceDowncastOutsideOptionalBindingError

type InvalidFailableResourceDowncastOutsideOptionalBindingError struct {
	ast.Range
}

func (*InvalidFailableResourceDowncastOutsideOptionalBindingError) Error

func (*InvalidFailableResourceDowncastOutsideOptionalBindingError) IsUserError added in v0.25.0

type InvalidFixedPointLiteralRangeError

type InvalidFixedPointLiteralRangeError struct {
	ExpectedType          Type
	ExpectedMinInt        *big.Int
	ExpectedMinFractional *big.Int
	ExpectedMaxInt        *big.Int
	ExpectedMaxFractional *big.Int
	ast.Range
}

func (*InvalidFixedPointLiteralRangeError) Error

func (*InvalidFixedPointLiteralRangeError) IsUserError added in v0.25.0

func (*InvalidFixedPointLiteralRangeError) IsUserError()

func (*InvalidFixedPointLiteralRangeError) SecondaryError

func (e *InvalidFixedPointLiteralRangeError) SecondaryError() string

type InvalidFixedPointLiteralScaleError

type InvalidFixedPointLiteralScaleError struct {
	ExpectedType  Type
	ExpectedScale uint
	ast.Range
}

func (*InvalidFixedPointLiteralScaleError) Error

func (*InvalidFixedPointLiteralScaleError) IsUserError added in v0.25.0

func (*InvalidFixedPointLiteralScaleError) IsUserError()

func (*InvalidFixedPointLiteralScaleError) SecondaryError

func (e *InvalidFixedPointLiteralScaleError) SecondaryError() string

type InvalidImplementationError

type InvalidImplementationError struct {
	ImplementedKind common.DeclarationKind
	ContainerKind   common.DeclarationKind
	Pos             ast.Position
}

func (*InvalidImplementationError) EndPosition

func (*InvalidImplementationError) Error

func (*InvalidImplementationError) IsUserError added in v0.25.0

func (*InvalidImplementationError) IsUserError()

func (*InvalidImplementationError) StartPosition

func (e *InvalidImplementationError) StartPosition() ast.Position

type InvalidIntegerLiteralRangeError

type InvalidIntegerLiteralRangeError struct {
	ExpectedType   Type
	ExpectedMinInt *big.Int
	ExpectedMaxInt *big.Int
	ast.Range
}

func (*InvalidIntegerLiteralRangeError) Error

func (*InvalidIntegerLiteralRangeError) IsUserError added in v0.25.0

func (*InvalidIntegerLiteralRangeError) IsUserError()

func (*InvalidIntegerLiteralRangeError) SecondaryError

func (e *InvalidIntegerLiteralRangeError) SecondaryError() string

type InvalidInterfaceConditionResourceInvalidationError added in v0.42.6

type InvalidInterfaceConditionResourceInvalidationError struct {
	ast.Range
}

func (*InvalidInterfaceConditionResourceInvalidationError) Error added in v0.42.6

func (*InvalidInterfaceConditionResourceInvalidationError) IsUserError added in v0.42.6

type InvalidInterfaceDeclarationError added in v0.10.0

type InvalidInterfaceDeclarationError struct {
	CompositeKind common.CompositeKind
	ast.Range
}

func (*InvalidInterfaceDeclarationError) Error added in v0.10.0

func (*InvalidInterfaceDeclarationError) IsUserError added in v0.25.0

func (*InvalidInterfaceDeclarationError) IsUserError()

type InvalidInterfaceTypeError

type InvalidInterfaceTypeError struct {
	ActualType   Type
	ExpectedType Type
	ast.Range
}

func (*InvalidInterfaceTypeError) Error

func (e *InvalidInterfaceTypeError) Error() string

func (*InvalidInterfaceTypeError) IsUserError added in v0.25.0

func (*InvalidInterfaceTypeError) IsUserError()

func (*InvalidInterfaceTypeError) SecondaryError

func (e *InvalidInterfaceTypeError) SecondaryError() string

type InvalidIntersectedTypeError added in v1.0.0

type InvalidIntersectedTypeError struct {
	Type Type
	ast.Range
}

func (*InvalidIntersectedTypeError) Error added in v1.0.0

func (*InvalidIntersectedTypeError) IsUserError added in v1.0.0

func (*InvalidIntersectedTypeError) IsUserError()

type InvalidIntersectionTypeDuplicateError added in v1.0.0

type InvalidIntersectionTypeDuplicateError struct {
	Type *InterfaceType
	ast.Range
}

func (*InvalidIntersectionTypeDuplicateError) Error added in v1.0.0

func (*InvalidIntersectionTypeDuplicateError) IsUserError added in v1.0.0

type InvalidMappedAuthorizationOutsideOfFieldError added in v1.0.0

type InvalidMappedAuthorizationOutsideOfFieldError struct {
	Map *EntitlementMapType
	ast.Range
}

InvalidMappedAuthorizationOutsideOfFieldError

func (*InvalidMappedAuthorizationOutsideOfFieldError) EndPosition added in v1.0.0

func (*InvalidMappedAuthorizationOutsideOfFieldError) Error added in v1.0.0

func (*InvalidMappedAuthorizationOutsideOfFieldError) IsUserError added in v1.0.0

func (*InvalidMappedAuthorizationOutsideOfFieldError) StartPosition added in v1.0.0

type InvalidMappedEntitlementMemberError added in v1.0.0

type InvalidMappedEntitlementMemberError struct {
	Pos ast.Position
}

InvalidMappedEntitlementMemberError

func (*InvalidMappedEntitlementMemberError) EndPosition added in v1.0.0

func (*InvalidMappedEntitlementMemberError) Error added in v1.0.0

func (*InvalidMappedEntitlementMemberError) IsUserError added in v1.0.0

func (*InvalidMappedEntitlementMemberError) IsUserError()

func (*InvalidMappedEntitlementMemberError) StartPosition added in v1.0.0

type InvalidMoveError

type InvalidMoveError struct {
	Name            string
	DeclarationKind common.DeclarationKind
	Pos             ast.Position
}

func (*InvalidMoveError) EndPosition

func (e *InvalidMoveError) EndPosition(memoryGauge common.MemoryGauge) ast.Position

func (*InvalidMoveError) Error

func (e *InvalidMoveError) Error() string

func (*InvalidMoveError) IsUserError added in v0.25.0

func (*InvalidMoveError) IsUserError()

func (*InvalidMoveError) StartPosition

func (e *InvalidMoveError) StartPosition() ast.Position

type InvalidMoveOperationError

type InvalidMoveOperationError struct {
	ast.Range
}

func (*InvalidMoveOperationError) Error

func (e *InvalidMoveOperationError) Error() string

func (*InvalidMoveOperationError) IsUserError added in v0.25.0

func (*InvalidMoveOperationError) IsUserError()

func (*InvalidMoveOperationError) SecondaryError

func (e *InvalidMoveOperationError) SecondaryError() string

type InvalidNameError

type InvalidNameError struct {
	Name string
	Pos  ast.Position
}

func (*InvalidNameError) EndPosition

func (e *InvalidNameError) EndPosition(memoryGauge common.MemoryGauge) ast.Position

func (*InvalidNameError) Error

func (e *InvalidNameError) Error() string

func (*InvalidNameError) IsUserError added in v0.25.0

func (*InvalidNameError) IsUserError()

func (*InvalidNameError) StartPosition

func (e *InvalidNameError) StartPosition() ast.Position

type InvalidNativeModifierError added in v0.30.0

type InvalidNativeModifierError struct {
	ast.Range
}

func (*InvalidNativeModifierError) Error added in v0.30.0

func (*InvalidNativeModifierError) IsUserError added in v0.30.0

func (*InvalidNativeModifierError) IsUserError()

type InvalidNestedDeclarationError

type InvalidNestedDeclarationError struct {
	NestedDeclarationKind    common.DeclarationKind
	ContainerDeclarationKind common.DeclarationKind
	ast.Range
}

func (*InvalidNestedDeclarationError) Error

func (*InvalidNestedDeclarationError) IsUserError added in v0.25.0

func (*InvalidNestedDeclarationError) IsUserError()

type InvalidNestedResourceMoveError

type InvalidNestedResourceMoveError struct {
	ast.Range
}

func (*InvalidNestedResourceMoveError) Error

func (*InvalidNestedResourceMoveError) IsUserError added in v0.25.0

func (*InvalidNestedResourceMoveError) IsUserError()

type InvalidNestedTypeError

type InvalidNestedTypeError struct {
	Type *ast.NominalType
}

func (*InvalidNestedTypeError) EndPosition

func (e *InvalidNestedTypeError) EndPosition(memoryGauge common.MemoryGauge) ast.Position

func (*InvalidNestedTypeError) Error

func (e *InvalidNestedTypeError) Error() string

func (*InvalidNestedTypeError) IsUserError added in v0.25.0

func (*InvalidNestedTypeError) IsUserError()

func (*InvalidNestedTypeError) StartPosition

func (e *InvalidNestedTypeError) StartPosition() ast.Position

type InvalidNilCoalescingRightResourceOperandError

type InvalidNilCoalescingRightResourceOperandError struct {
	ast.Range
}

func (*InvalidNilCoalescingRightResourceOperandError) Error

type InvalidNonEntitlementAccessError added in v1.0.0

type InvalidNonEntitlementAccessError struct {
	ast.Range
}

InvalidNonEntitlementAccessError

func (*InvalidNonEntitlementAccessError) Error added in v1.0.0

func (*InvalidNonEntitlementAccessError) IsUserError added in v1.0.0

func (*InvalidNonEntitlementAccessError) IsUserError()

type InvalidNonEntitlementTypeInMapError added in v1.0.0

type InvalidNonEntitlementTypeInMapError struct {
	Pos ast.Position
}

InvalidNonEntitlementTypeInMapError

func (*InvalidNonEntitlementTypeInMapError) EndPosition added in v1.0.0

func (*InvalidNonEntitlementTypeInMapError) Error added in v1.0.0

func (*InvalidNonEntitlementTypeInMapError) IsUserError added in v1.0.0

func (*InvalidNonEntitlementTypeInMapError) IsUserError()

func (*InvalidNonEntitlementTypeInMapError) StartPosition added in v1.0.0

type InvalidNonEnumCaseError added in v0.10.0

type InvalidNonEnumCaseError struct {
	ContainerDeclarationKind common.DeclarationKind
	ast.Range
}

func (*InvalidNonEnumCaseError) Error added in v0.10.0

func (e *InvalidNonEnumCaseError) Error() string

func (*InvalidNonEnumCaseError) IsUserError added in v0.25.0

func (*InvalidNonEnumCaseError) IsUserError()

type InvalidNonIdentifierFailableResourceDowncast added in v0.12.0

type InvalidNonIdentifierFailableResourceDowncast struct {
	ast.Range
}

func (*InvalidNonIdentifierFailableResourceDowncast) Error added in v0.12.0

func (*InvalidNonIdentifierFailableResourceDowncast) IsUserError added in v0.25.0

func (*InvalidNonIdentifierFailableResourceDowncast) SecondaryError added in v0.12.0

type InvalidNonImportableTransactionParameterTypeError added in v0.17.0

type InvalidNonImportableTransactionParameterTypeError struct {
	Type Type
	ast.Range
}

func (*InvalidNonImportableTransactionParameterTypeError) Error added in v0.17.0

func (*InvalidNonImportableTransactionParameterTypeError) IsUserError added in v0.25.0

type InvalidOptionalChainingError

type InvalidOptionalChainingError struct {
	Type Type
	ast.Range
}

func (*InvalidOptionalChainingError) Error

func (*InvalidOptionalChainingError) IsUserError added in v0.25.0

func (*InvalidOptionalChainingError) IsUserError()

type InvalidPathDomainError

type InvalidPathDomainError struct {
	ActualDomain string
	ast.Range
}

func (*InvalidPathDomainError) Error

func (e *InvalidPathDomainError) Error() string

func (*InvalidPathDomainError) IsUserError added in v0.25.0

func (*InvalidPathDomainError) IsUserError()

func (*InvalidPathDomainError) SecondaryError

func (e *InvalidPathDomainError) SecondaryError() string

type InvalidPathIdentifierError added in v0.23.0

type InvalidPathIdentifierError struct {
	ActualIdentifier string
	ast.Range
}

func (*InvalidPathIdentifierError) Error added in v0.23.0

type InvalidPragmaError added in v0.7.0

type InvalidPragmaError struct {
	Message string
	ast.Range
}

func (*InvalidPragmaError) Error added in v0.7.0

func (e *InvalidPragmaError) Error() string

func (*InvalidPragmaError) IsUserError added in v0.25.0

func (*InvalidPragmaError) IsUserError()

func (*InvalidPragmaError) SecondaryError added in v0.31.6

func (e *InvalidPragmaError) SecondaryError() string

type InvalidResourceAnnotationError

type InvalidResourceAnnotationError struct {
	ast.Range
}

func (*InvalidResourceAnnotationError) Error

func (*InvalidResourceAnnotationError) IsUserError added in v0.25.0

func (*InvalidResourceAnnotationError) IsUserError()

type InvalidResourceArrayMemberError

type InvalidResourceArrayMemberError struct {
	Name            string
	DeclarationKind common.DeclarationKind
	ast.Range
}

func (*InvalidResourceArrayMemberError) Error

func (*InvalidResourceArrayMemberError) IsUserError added in v0.25.0

func (*InvalidResourceArrayMemberError) IsUserError()

type InvalidResourceAssignmentError

type InvalidResourceAssignmentError struct {
	ast.Range
}

func (*InvalidResourceAssignmentError) Error

func (*InvalidResourceAssignmentError) IsUserError added in v0.25.0

func (*InvalidResourceAssignmentError) IsUserError()

func (*InvalidResourceAssignmentError) SecondaryError added in v0.25.0

func (e *InvalidResourceAssignmentError) SecondaryError() string

type InvalidResourceCreationError

type InvalidResourceCreationError struct {
	Type Type
	ast.Range
}

func (*InvalidResourceCreationError) Error

func (*InvalidResourceCreationError) IsUserError added in v0.25.0

func (*InvalidResourceCreationError) IsUserError()

type InvalidResourceDictionaryMemberError

type InvalidResourceDictionaryMemberError struct {
	Name            string
	DeclarationKind common.DeclarationKind
	ast.Range
}

func (*InvalidResourceDictionaryMemberError) Error

func (*InvalidResourceDictionaryMemberError) IsUserError added in v0.25.0

func (*InvalidResourceDictionaryMemberError) IsUserError()

type InvalidResourceFieldError

type InvalidResourceFieldError struct {
	Name          string
	CompositeKind common.CompositeKind
	Pos           ast.Position
}

func (*InvalidResourceFieldError) EndPosition

func (e *InvalidResourceFieldError) EndPosition(memoryGauge common.MemoryGauge) ast.Position

func (*InvalidResourceFieldError) Error

func (e *InvalidResourceFieldError) Error() string

func (*InvalidResourceFieldError) IsUserError added in v0.25.0

func (*InvalidResourceFieldError) IsUserError()

func (*InvalidResourceFieldError) StartPosition

func (e *InvalidResourceFieldError) StartPosition() ast.Position

type InvalidResourceOptionalMemberError added in v0.9.0

type InvalidResourceOptionalMemberError struct {
	Name            string
	DeclarationKind common.DeclarationKind
	ast.Range
}

func (*InvalidResourceOptionalMemberError) Error added in v0.9.0

func (*InvalidResourceOptionalMemberError) IsUserError added in v0.25.0

func (*InvalidResourceOptionalMemberError) IsUserError()

type InvalidResourceTransactionParameterError

type InvalidResourceTransactionParameterError struct {
	Type Type
	ast.Range
}

func (*InvalidResourceTransactionParameterError) Error

func (*InvalidResourceTransactionParameterError) IsUserError added in v0.25.0

type InvalidSelfInvalidationError

type InvalidSelfInvalidationError struct {
	InvalidationKind ResourceInvalidationKind
	ast.Range
}

func (*InvalidSelfInvalidationError) Error

func (*InvalidSelfInvalidationError) IsUserError added in v0.25.0

func (*InvalidSelfInvalidationError) IsUserError()

type InvalidStaticModifierError added in v0.30.0

type InvalidStaticModifierError struct {
	ast.Range
}

func (*InvalidStaticModifierError) Error added in v0.30.0

func (*InvalidStaticModifierError) IsUserError added in v0.30.0

func (*InvalidStaticModifierError) IsUserError()

type InvalidSwapExpressionError

type InvalidSwapExpressionError struct {
	Side common.OperandSide
	ast.Range
}

func (*InvalidSwapExpressionError) Error

func (*InvalidSwapExpressionError) IsUserError added in v0.25.0

func (*InvalidSwapExpressionError) IsUserError()

func (*InvalidSwapExpressionError) SecondaryError

func (e *InvalidSwapExpressionError) SecondaryError() string

type InvalidTopLevelDeclarationError

type InvalidTopLevelDeclarationError struct {
	DeclarationKind common.DeclarationKind
	ast.Range
}

func (*InvalidTopLevelDeclarationError) Error

func (*InvalidTopLevelDeclarationError) IsUserError added in v0.25.0

func (*InvalidTopLevelDeclarationError) IsUserError()

type InvalidTransactionBlockError

type InvalidTransactionBlockError struct {
	Name string
	Pos  ast.Position
}

func (*InvalidTransactionBlockError) EndPosition

func (e *InvalidTransactionBlockError) EndPosition(memoryGauge common.MemoryGauge) ast.Position

func (*InvalidTransactionBlockError) Error

func (*InvalidTransactionBlockError) IsUserError added in v0.25.0

func (*InvalidTransactionBlockError) IsUserError()

func (*InvalidTransactionBlockError) SecondaryError

func (e *InvalidTransactionBlockError) SecondaryError() string

func (*InvalidTransactionBlockError) StartPosition

func (e *InvalidTransactionBlockError) StartPosition() ast.Position

type InvalidTransactionFieldAccessModifierError

type InvalidTransactionFieldAccessModifierError struct {
	Name   string
	Access ast.Access
	Pos    ast.Position
}

func (*InvalidTransactionFieldAccessModifierError) EndPosition

func (*InvalidTransactionFieldAccessModifierError) Error

func (*InvalidTransactionFieldAccessModifierError) IsUserError added in v0.25.0

func (*InvalidTransactionFieldAccessModifierError) StartPosition

type InvalidTransactionPrepareParameterTypeError

type InvalidTransactionPrepareParameterTypeError struct {
	Type Type
	ast.Range
}

func (*InvalidTransactionPrepareParameterTypeError) Error

func (*InvalidTransactionPrepareParameterTypeError) IsUserError added in v0.25.0

type InvalidTypeArgumentCountError

type InvalidTypeArgumentCountError struct {
	TypeParameterCount int
	TypeArgumentCount  int
	ast.Range
}

func (*InvalidTypeArgumentCountError) Error

func (*InvalidTypeArgumentCountError) IsUserError added in v0.25.0

func (*InvalidTypeArgumentCountError) IsUserError()

func (*InvalidTypeArgumentCountError) SecondaryError

func (e *InvalidTypeArgumentCountError) SecondaryError() string

type InvalidTypeArgumentError added in v1.0.0

type InvalidTypeArgumentError struct {
	TypeArgumentName string
	Details          string
	ast.Range
}

func (*InvalidTypeArgumentError) Error added in v1.0.0

func (e *InvalidTypeArgumentError) Error() string

func (*InvalidTypeArgumentError) IsUserError added in v1.0.0

func (*InvalidTypeArgumentError) IsUserError()

func (*InvalidTypeArgumentError) SecondaryError added in v1.0.0

func (e *InvalidTypeArgumentError) SecondaryError() string

type InvalidTypeIndexingError

type InvalidTypeIndexingError struct {
	IndexingExpression ast.Expression
	BaseType           Type
	ast.Range
}

InvalidTypeIndexingError

func (*InvalidTypeIndexingError) Error

func (e *InvalidTypeIndexingError) Error() string

func (*InvalidTypeIndexingError) IsUserError added in v0.36.0

func (*InvalidTypeIndexingError) IsUserError()

type InvalidTypeParameterizedNonNativeFunctionError added in v0.42.1

type InvalidTypeParameterizedNonNativeFunctionError struct {
	ast.Range
}

func (*InvalidTypeParameterizedNonNativeFunctionError) Error added in v0.42.1

func (*InvalidTypeParameterizedNonNativeFunctionError) IsUserError added in v0.42.1

type InvalidUnaryOperandError

type InvalidUnaryOperandError struct {
	ExpectedType            Type
	ExpectedTypeDescription string
	ActualType              Type
	ast.Range
	Operation ast.Operation
}

func (*InvalidUnaryOperandError) Error

func (e *InvalidUnaryOperandError) Error() string

func (*InvalidUnaryOperandError) IsUserError added in v0.25.0

func (*InvalidUnaryOperandError) IsUserError()

func (*InvalidUnaryOperandError) SecondaryError

func (e *InvalidUnaryOperandError) SecondaryError() string

type InvalidVariableKindError

type InvalidVariableKindError struct {
	Kind ast.VariableKind
	ast.Range
}

func (*InvalidVariableKindError) Error

func (e *InvalidVariableKindError) Error() string

func (*InvalidVariableKindError) IsUserError added in v0.25.0

func (*InvalidVariableKindError) IsUserError()

type InvalidatedResourceReferenceError added in v0.32.0

type InvalidatedResourceReferenceError struct {
	Invalidation ResourceInvalidation
	ast.Range
}

func (*InvalidatedResourceReferenceError) Error added in v0.32.0

func (*InvalidatedResourceReferenceError) ErrorNotes added in v0.32.0

func (*InvalidatedResourceReferenceError) IsUserError added in v0.32.0

func (*InvalidatedResourceReferenceError) IsUserError()

type InvocationExpressionTypes added in v0.26.0

type InvocationExpressionTypes struct {
	ReturnType         Type
	TypeArguments      *TypeParameterTypeOrderedMap
	ArgumentTypes      []Type
	TypeParameterTypes []Type
}

type LocatedType

type LocatedType interface {
	Type
	GetLocation() common.Location
}

LocatedType is a type which has a location

type LocationHandlerFunc added in v0.10.0

type LocationHandlerFunc func(identifiers []ast.Identifier, location common.Location) ([]ResolvedLocation, error)

func AddressLocationHandlerFunc added in v0.25.0

func AddressLocationHandlerFunc(resolveAddressContractNames AddressContractNamesResolver) LocationHandlerFunc

AddressLocationHandlerFunc returns a location handler which returns a single location for non-address locations, and uses the given address contract names resolve function to get all contract names for an address

type MappingAccessMissingKeywordError added in v1.0.0

type MappingAccessMissingKeywordError struct {
	Type Type
	ast.Range
}

MappingAccessMissingKeywordError

func (*MappingAccessMissingKeywordError) Error added in v1.0.0

func (*MappingAccessMissingKeywordError) IsUserError added in v1.0.0

func (*MappingAccessMissingKeywordError) IsUserError()

func (*MappingAccessMissingKeywordError) SecondaryError added in v1.0.0

func (e *MappingAccessMissingKeywordError) SecondaryError() string

type Member

type Member struct {
	TypeAnnotation TypeAnnotation
	// Parent type where this member can be resolved
	ContainerType  Type
	DocString      string
	ArgumentLabels []string
	Identifier     ast.Identifier
	Access         Access
	// TODO: replace with dedicated MemberKind enum
	DeclarationKind common.DeclarationKind
	VariableKind    ast.VariableKind
	// Predeclared fields can be considered initialized
	Predeclared       bool
	HasImplementation bool
	HasConditions     bool
	// IgnoreInSerialization determines if the field is ignored in serialization
	IgnoreInSerialization bool
}

func NewConstructorMember added in v1.0.0

func NewConstructorMember(
	memoryGauge common.MemoryGauge,
	containerType Type,
	access Access,
	identifier string,
	functionType *FunctionType,
	docString string,
) *Member

func NewFieldMember added in v0.39.0

func NewFieldMember(
	memoryGauge common.MemoryGauge,
	containerType Type,
	access Access,
	variableKind ast.VariableKind,
	identifier string,
	fieldType Type,
	docString string,
) *Member

func NewFunctionMember added in v0.39.0

func NewFunctionMember(
	memoryGauge common.MemoryGauge,
	containerType Type,
	access Access,
	identifier string,
	functionType *FunctionType,
	docString string,
) *Member

func NewPublicConstantFieldMember

func NewPublicConstantFieldMember(
	memoryGauge common.MemoryGauge,
	containerType Type,
	identifier string,
	fieldType Type,
	docString string,
) *Member

func NewPublicFunctionMember

func NewPublicFunctionMember(
	memoryGauge common.MemoryGauge,
	containerType Type,
	identifier string,
	functionType *FunctionType,
	docString string,
) *Member

func NewUnmeteredConstructorMember added in v1.0.0

func NewUnmeteredConstructorMember(
	containerType Type,
	access Access,
	identifier string,
	functionType *FunctionType,
	docString string,
) *Member

func NewUnmeteredFieldMember added in v0.39.0

func NewUnmeteredFieldMember(
	containerType Type,
	access Access,
	variableKind ast.VariableKind,
	identifier string,
	fieldType Type,
	docString string,
) *Member

func NewUnmeteredFunctionMember added in v0.39.0

func NewUnmeteredFunctionMember(
	containerType Type,
	access Access,
	identifier string,
	functionType *FunctionType,
	docString string,
) *Member

func NewUnmeteredPublicConstantFieldMember added in v0.24.0

func NewUnmeteredPublicConstantFieldMember(
	containerType Type,
	identifier string,
	fieldType Type,
	docString string,
) *Member

func NewUnmeteredPublicFunctionMember added in v0.24.0

func NewUnmeteredPublicFunctionMember(
	containerType Type,
	identifier string,
	functionType *FunctionType,
	docString string,
) *Member

func (*Member) IsExportable added in v0.30.0

func (m *Member) IsExportable(results map[*Member]bool) (result bool)

IsExportable returns whether a member is exportable

func (*Member) IsImportable added in v0.17.0

func (m *Member) IsImportable(results map[*Member]bool) (result bool)

IsImportable returns whether a member can be imported to a program

func (*Member) IsStorable added in v0.5.0

func (m *Member) IsStorable(results map[*Member]bool) (result bool)

IsStorable returns whether a member is a storable field

func (*Member) IsValidEventParameterType added in v0.14.2

func (m *Member) IsValidEventParameterType(results map[*Member]bool) bool

IsValidEventParameterType returns whether has a valid event parameter type

type MemberAccess added in v0.7.0

type MemberAccess struct {
	AccessedType Type
	StartPos     Position
	EndPos       Position
}

type MemberAccessInfo added in v1.0.0

type MemberAccessInfo struct {
	AccessedType    Type
	ResultingType   Type
	Member          *Member
	IsOptional      bool
	ReturnReference bool
}

type MemberAccesses added in v0.7.0

type MemberAccesses struct {
	// contains filtered or unexported fields
}

func NewMemberAccesses added in v0.7.0

func NewMemberAccesses() *MemberAccesses

func (*MemberAccesses) All added in v0.7.0

func (m *MemberAccesses) All() []MemberAccess

func (*MemberAccesses) Find added in v0.7.0

func (m *MemberAccesses) Find(pos Position) *MemberAccess

func (*MemberAccesses) Put added in v0.7.0

func (m *MemberAccesses) Put(startPos, endPos ast.Position, accessedType Type)

type MemberAccountAccessHandlerFunc added in v0.19.0

type MemberAccountAccessHandlerFunc func(checker *Checker, memberLocation common.Location) bool

type MemberFieldDeclarationOrderedMap added in v0.25.0

type MemberFieldDeclarationOrderedMap = orderedmap.OrderedMap[*Member, *ast.FieldDeclaration]

type MemberMismatch

type MemberMismatch struct {
	CompositeMember *Member
	InterfaceMember *Member
}

type MemberMismatchNote added in v0.2.0

type MemberMismatchNote struct {
	ast.Range
}

func (MemberMismatchNote) Message added in v0.2.0

func (n MemberMismatchNote) Message() string

type MemberResolver added in v0.7.0

type MemberResolver struct {
	Resolve func(
		memoryGauge common.MemoryGauge,
		identifier string,
		targetRange ast.HasPosition,
		report func(error),
	) *Member
	Kind common.DeclarationKind
}

type MissingAccessModifierError

type MissingAccessModifierError struct {
	Explanation     string
	Pos             ast.Position
	DeclarationKind common.DeclarationKind
}

func (*MissingAccessModifierError) EndPosition

func (*MissingAccessModifierError) Error

func (*MissingAccessModifierError) IsUserError added in v0.25.0

func (*MissingAccessModifierError) IsUserError()

func (*MissingAccessModifierError) StartPosition

func (e *MissingAccessModifierError) StartPosition() ast.Position

type MissingArgumentLabelError

type MissingArgumentLabelError struct {
	ExpectedArgumentLabel string
	ast.Range
}

func (*MissingArgumentLabelError) Error

func (e *MissingArgumentLabelError) Error() string

func (*MissingArgumentLabelError) IsUserError added in v0.25.0

func (*MissingArgumentLabelError) IsUserError()

func (*MissingArgumentLabelError) SuggestFixes added in v0.40.0

type MissingConformanceError

type MissingConformanceError struct {
	CompositeType *CompositeType
	InterfaceType *InterfaceType
	ast.Range
}

MissingConformanceError

func (*MissingConformanceError) Error

func (e *MissingConformanceError) Error() string

func (*MissingConformanceError) IsUserError added in v0.25.0

func (*MissingConformanceError) IsUserError()

type MissingCreateError

type MissingCreateError struct {
	ast.Range
}

func (*MissingCreateError) Error

func (e *MissingCreateError) Error() string

func (*MissingCreateError) IsUserError added in v0.25.0

func (*MissingCreateError) IsUserError()

func (*MissingCreateError) SecondaryError

func (e *MissingCreateError) SecondaryError() string

type MissingEntryPointError added in v0.11.0

type MissingEntryPointError struct {
	Expected string
}

func (*MissingEntryPointError) Error added in v0.11.0

func (e *MissingEntryPointError) Error() string

func (*MissingEntryPointError) IsUserError added in v0.25.0

func (*MissingEntryPointError) IsUserError()

type MissingEnumRawTypeError added in v0.10.0

type MissingEnumRawTypeError struct {
	Pos ast.Position
}

func (*MissingEnumRawTypeError) EndPosition added in v0.10.0

func (*MissingEnumRawTypeError) Error added in v0.10.0

func (e *MissingEnumRawTypeError) Error() string

func (*MissingEnumRawTypeError) IsUserError added in v0.25.0

func (*MissingEnumRawTypeError) IsUserError()

func (*MissingEnumRawTypeError) StartPosition added in v0.10.0

func (e *MissingEnumRawTypeError) StartPosition() ast.Position

type MissingFunctionBodyError

type MissingFunctionBodyError struct {
	Pos ast.Position
}

func (*MissingFunctionBodyError) EndPosition

func (*MissingFunctionBodyError) Error

func (e *MissingFunctionBodyError) Error() string

func (*MissingFunctionBodyError) IsUserError added in v0.25.0

func (*MissingFunctionBodyError) IsUserError()

func (*MissingFunctionBodyError) StartPosition

func (e *MissingFunctionBodyError) StartPosition() ast.Position

type MissingInitializerError

type MissingInitializerError struct {
	ContainerType  Type
	FirstFieldName string
	FirstFieldPos  ast.Position
}

func (*MissingInitializerError) EndPosition

func (e *MissingInitializerError) EndPosition(memoryGauge common.MemoryGauge) ast.Position

func (*MissingInitializerError) Error

func (e *MissingInitializerError) Error() string

func (*MissingInitializerError) IsUserError added in v0.25.0

func (*MissingInitializerError) IsUserError()

func (*MissingInitializerError) StartPosition

func (e *MissingInitializerError) StartPosition() ast.Position

type MissingMoveOperationError

type MissingMoveOperationError struct {
	Pos ast.Position
}

func (*MissingMoveOperationError) EndPosition

func (*MissingMoveOperationError) Error

func (e *MissingMoveOperationError) Error() string

func (*MissingMoveOperationError) IsUserError added in v0.25.0

func (*MissingMoveOperationError) IsUserError()

func (*MissingMoveOperationError) StartPosition

func (e *MissingMoveOperationError) StartPosition() ast.Position

type MissingResourceAnnotationError

type MissingResourceAnnotationError struct {
	ast.Range
}

func (*MissingResourceAnnotationError) Error

func (*MissingResourceAnnotationError) IsUserError added in v0.25.0

func (*MissingResourceAnnotationError) IsUserError()

type MissingReturnStatementError

type MissingReturnStatementError struct {
	ast.Range
}

func (*MissingReturnStatementError) Error

func (*MissingReturnStatementError) IsUserError added in v0.25.0

func (*MissingReturnStatementError) IsUserError()

type MissingReturnValueError added in v0.5.0

type MissingReturnValueError struct {
	ExpectedValueType Type
	ast.Range
}

func (*MissingReturnValueError) Error added in v0.5.0

func (e *MissingReturnValueError) Error() string

func (*MissingReturnValueError) IsUserError added in v0.25.0

func (*MissingReturnValueError) IsUserError()

type MissingSwitchCaseStatementsError added in v0.10.0

type MissingSwitchCaseStatementsError struct {
	Pos ast.Position
}

func (*MissingSwitchCaseStatementsError) EndPosition added in v0.10.0

func (*MissingSwitchCaseStatementsError) Error added in v0.10.0

func (*MissingSwitchCaseStatementsError) IsUserError added in v0.25.0

func (*MissingSwitchCaseStatementsError) IsUserError()

func (*MissingSwitchCaseStatementsError) StartPosition added in v0.10.0

func (e *MissingSwitchCaseStatementsError) StartPosition() ast.Position

type MissingTypeArgumentError added in v1.0.0

type MissingTypeArgumentError struct {
	TypeArgumentName string
	ast.Range
}

func (*MissingTypeArgumentError) Error added in v1.0.0

func (e *MissingTypeArgumentError) Error() string

func (*MissingTypeArgumentError) IsUserError added in v1.0.0

func (*MissingTypeArgumentError) IsUserError()

type MultipleInterfaceDefaultImplementationsError added in v0.26.0

type MultipleInterfaceDefaultImplementationsError struct {
	CompositeKindedType CompositeKindedType
	Member              *Member
	ast.Range
}

MultipleInterfaceDefaultImplementationsError

func (*MultipleInterfaceDefaultImplementationsError) Error added in v0.26.0

func (*MultipleInterfaceDefaultImplementationsError) IsUserError added in v0.26.0

type NativeFunctionWithImplementationError added in v0.42.0

type NativeFunctionWithImplementationError struct {
	ast.Range
}

func (*NativeFunctionWithImplementationError) Error added in v0.42.0

func (*NativeFunctionWithImplementationError) IsUserError added in v0.42.0

type NestedReferenceError added in v1.0.0

type NestedReferenceError struct {
	Type *ReferenceType
	ast.Range
}

NestedReferenceError

func (*NestedReferenceError) Error added in v1.0.0

func (e *NestedReferenceError) Error() string

func (*NestedReferenceError) IsUserError added in v1.0.0

func (*NestedReferenceError) IsUserError()

type NominalType added in v0.11.0

type NominalType interface {
	Type
	MemberMap() *StringMemberOrderedMap
}

supertype of interfaces and composites

type NonReferenceTypeReferenceError

type NonReferenceTypeReferenceError struct {
	ActualType Type
	ast.Range
}

func (*NonReferenceTypeReferenceError) Error

func (*NonReferenceTypeReferenceError) IsUserError added in v0.25.0

func (*NonReferenceTypeReferenceError) IsUserError()

func (*NonReferenceTypeReferenceError) SecondaryError

func (e *NonReferenceTypeReferenceError) SecondaryError() string

type NonResourceTypeError

type NonResourceTypeError struct {
	ActualType Type
	ast.Range
}

func (*NonResourceTypeError) Error

func (e *NonResourceTypeError) Error() string

func (*NonResourceTypeError) IsUserError added in v0.25.0

func (*NonResourceTypeError) IsUserError()

func (*NonResourceTypeError) SecondaryError

func (e *NonResourceTypeError) SecondaryError() string

type NotCallableError

type NotCallableError struct {
	Type Type
	ast.Range
}

func (*NotCallableError) Error

func (e *NotCallableError) Error() string

func (*NotCallableError) IsUserError added in v0.25.0

func (*NotCallableError) IsUserError()

type NotDeclaredError

type NotDeclaredError struct {
	Expression   *ast.IdentifierExpression
	Name         string
	Pos          ast.Position
	ExpectedKind common.DeclarationKind
}

func (*NotDeclaredError) EndPosition

func (e *NotDeclaredError) EndPosition(memoryGauge common.MemoryGauge) ast.Position

func (*NotDeclaredError) Error

func (e *NotDeclaredError) Error() string

func (*NotDeclaredError) IsUserError added in v0.25.0

func (*NotDeclaredError) IsUserError()

func (*NotDeclaredError) SecondaryError

func (e *NotDeclaredError) SecondaryError() string

func (*NotDeclaredError) StartPosition

func (e *NotDeclaredError) StartPosition() ast.Position

type NotDeclaredMemberError

type NotDeclaredMemberError struct {
	Type       Type
	Expression *ast.MemberExpression
	Name       string
	ast.Range
	// contains filtered or unexported fields
}

func (*NotDeclaredMemberError) Error

func (e *NotDeclaredMemberError) Error() string

func (*NotDeclaredMemberError) IsUserError added in v0.25.0

func (*NotDeclaredMemberError) IsUserError()

func (*NotDeclaredMemberError) SecondaryError

func (e *NotDeclaredMemberError) SecondaryError() string

func (*NotDeclaredMemberError) SuggestFixes added in v0.40.0

type NotEquatableTypeError

type NotEquatableTypeError struct {
	Type Type
	ast.Range
}

func (*NotEquatableTypeError) Error

func (e *NotEquatableTypeError) Error() string

func (*NotEquatableTypeError) IsUserError added in v0.25.0

func (*NotEquatableTypeError) IsUserError()

type NotExportedError

type NotExportedError struct {
	Name           string
	ImportLocation common.Location
	Available      []string
	Pos            ast.Position
}

func (*NotExportedError) EndPosition

func (e *NotExportedError) EndPosition(memoryGauge common.MemoryGauge) ast.Position

func (*NotExportedError) Error

func (e *NotExportedError) Error() string

func (*NotExportedError) IsUserError added in v0.25.0

func (*NotExportedError) IsUserError()

func (*NotExportedError) SecondaryError added in v0.8.0

func (e *NotExportedError) SecondaryError() string

func (*NotExportedError) StartPosition

func (e *NotExportedError) StartPosition() ast.Position

type NotIndexableTypeError

type NotIndexableTypeError struct {
	Type Type
	ast.Range
}

func (*NotIndexableTypeError) Error

func (e *NotIndexableTypeError) Error() string

func (*NotIndexableTypeError) IsUserError added in v0.25.0

func (*NotIndexableTypeError) IsUserError()

type NotIndexingAssignableTypeError added in v0.7.0

type NotIndexingAssignableTypeError struct {
	Type Type
	ast.Range
}

func (*NotIndexingAssignableTypeError) Error added in v0.7.0

func (*NotIndexingAssignableTypeError) IsUserError added in v0.25.0

func (*NotIndexingAssignableTypeError) IsUserError()

type NumberConversionArgumentTypes added in v0.30.0

type NumberConversionArgumentTypes struct {
	Type  Type
	Range ast.Range
}

type NumericType added in v0.15.0

type NumericType struct {
	// contains filtered or unexported fields
}

NumericType represent all the types in the integer range and non-fractional ranged types.

func NewNumericType added in v0.15.0

func NewNumericType(typeName string) *NumericType

func (*NumericType) AsSuperType added in v0.24.0

func (t *NumericType) AsSuperType() *NumericType

func (*NumericType) ByteSize added in v1.0.0

func (t *NumericType) ByteSize() int

func (*NumericType) CheckInstantiated added in v1.0.0

func (*NumericType) CheckInstantiated(_ ast.HasPosition, _ common.MemoryGauge, _ func(err error))

func (*NumericType) ContainFieldsOrElements added in v1.0.0

func (t *NumericType) ContainFieldsOrElements() bool

func (*NumericType) Equal added in v0.15.0

func (t *NumericType) Equal(other Type) bool

func (*NumericType) GetMembers added in v0.15.0

func (t *NumericType) GetMembers() map[string]MemberResolver

func (*NumericType) ID added in v0.15.0

func (t *NumericType) ID() TypeID

func (*NumericType) IsComparable added in v0.39.0

func (t *NumericType) IsComparable() bool

func (*NumericType) IsEquatable added in v0.15.0

func (*NumericType) IsEquatable() bool

func (*NumericType) IsExportable added in v0.30.0

func (*NumericType) IsExportable(_ map[*Member]bool) bool

func (*NumericType) IsImportable added in v0.17.0

func (t *NumericType) IsImportable(_ map[*Member]bool) bool

func (*NumericType) IsInvalidType added in v0.15.0

func (*NumericType) IsInvalidType() bool

func (*NumericType) IsOrContainsReferenceType added in v1.0.0

func (*NumericType) IsOrContainsReferenceType() bool

func (*NumericType) IsPrimitiveType added in v1.0.0

func (*NumericType) IsPrimitiveType() bool

func (*NumericType) IsResourceType added in v0.15.0

func (*NumericType) IsResourceType() bool

func (*NumericType) IsStorable added in v0.15.0

func (*NumericType) IsStorable(_ map[*Member]bool) bool

func (*NumericType) IsSuperType added in v0.24.0

func (t *NumericType) IsSuperType() bool

func (*NumericType) IsType added in v0.15.0

func (*NumericType) IsType()

func (*NumericType) Map added in v1.0.0

func (t *NumericType) Map(_ common.MemoryGauge, _ map[*TypeParameter]*TypeParameter, f func(Type) Type) Type

func (*NumericType) MaxInt added in v0.15.0

func (t *NumericType) MaxInt() *big.Int

func (*NumericType) MinInt added in v0.15.0

func (t *NumericType) MinInt() *big.Int

func (*NumericType) QualifiedString added in v0.15.0

func (t *NumericType) QualifiedString() string

func (*NumericType) Resolve added in v0.15.0

func (*NumericType) RewriteWithIntersectionTypes added in v1.0.0

func (t *NumericType) RewriteWithIntersectionTypes() (result Type, rewritten bool)

func (*NumericType) String added in v0.15.0

func (t *NumericType) String() string

func (*NumericType) SupportsSaturatingAdd added in v0.15.0

func (t *NumericType) SupportsSaturatingAdd() bool

func (*NumericType) SupportsSaturatingDivide added in v0.15.0

func (t *NumericType) SupportsSaturatingDivide() bool

func (*NumericType) SupportsSaturatingMultiply added in v0.15.0

func (t *NumericType) SupportsSaturatingMultiply() bool

func (*NumericType) SupportsSaturatingSubtract added in v0.15.0

func (t *NumericType) SupportsSaturatingSubtract() bool

func (*NumericType) Tag added in v0.24.0

func (t *NumericType) Tag() TypeTag

func (*NumericType) TypeAnnotationState added in v0.15.0

func (*NumericType) TypeAnnotationState() TypeAnnotationState

func (*NumericType) Unify added in v0.15.0

func (*NumericType) WithByteSize added in v1.0.0

func (t *NumericType) WithByteSize(size int) *NumericType

func (*NumericType) WithIntRange added in v0.15.0

func (t *NumericType) WithIntRange(min *big.Int, max *big.Int) *NumericType

func (*NumericType) WithSaturatingFunctions added in v0.40.0

func (t *NumericType) WithSaturatingFunctions(saturatingArithmetic SaturatingArithmeticSupport) *NumericType

func (*NumericType) WithTag added in v0.24.0

func (t *NumericType) WithTag(tag TypeTag) *NumericType

type Occurrence

type Occurrence struct {
	Origin   *Origin
	StartPos Position
	EndPos   Position
}

type Occurrences

type Occurrences struct {
	// contains filtered or unexported fields
}

func NewOccurrences

func NewOccurrences() *Occurrences

func (*Occurrences) All

func (o *Occurrences) All() []Occurrence

func (*Occurrences) Find

func (o *Occurrences) Find(pos Position) *Occurrence

func (*Occurrences) FindAll added in v0.17.0

func (o *Occurrences) FindAll(pos Position) []Occurrence

func (*Occurrences) Put

func (o *Occurrences) Put(startPos, endPos ast.Position, origin *Origin)

type OptionalType

type OptionalType struct {
	Type Type
	// contains filtered or unexported fields
}

OptionalType represents the optional variant of another type

func NewOptionalType added in v0.24.0

func NewOptionalType(memoryGauge common.MemoryGauge, typ Type) *OptionalType

func (*OptionalType) CheckInstantiated added in v1.0.0

func (t *OptionalType) CheckInstantiated(pos ast.HasPosition, memoryGauge common.MemoryGauge, report func(err error))

func (*OptionalType) ContainFieldsOrElements added in v1.0.0

func (t *OptionalType) ContainFieldsOrElements() bool

func (*OptionalType) Equal

func (t *OptionalType) Equal(other Type) bool

func (*OptionalType) GetMembers added in v0.7.0

func (t *OptionalType) GetMembers() map[string]MemberResolver

func (*OptionalType) ID

func (t *OptionalType) ID() TypeID

func (*OptionalType) IsComparable added in v0.39.0

func (*OptionalType) IsComparable() bool

func (*OptionalType) IsEquatable added in v0.7.0

func (t *OptionalType) IsEquatable() bool

func (*OptionalType) IsExportable added in v0.30.0

func (t *OptionalType) IsExportable(results map[*Member]bool) bool

func (*OptionalType) IsImportable added in v0.17.0

func (t *OptionalType) IsImportable(results map[*Member]bool) bool

func (*OptionalType) IsInvalidType

func (t *OptionalType) IsInvalidType() bool

func (*OptionalType) IsOrContainsReferenceType added in v1.0.0

func (t *OptionalType) IsOrContainsReferenceType() bool

func (*OptionalType) IsPrimitiveType added in v1.0.0

func (t *OptionalType) IsPrimitiveType() bool

func (*OptionalType) IsResourceType

func (t *OptionalType) IsResourceType() bool

func (*OptionalType) IsStorable added in v0.5.0

func (t *OptionalType) IsStorable(results map[*Member]bool) bool

func (*OptionalType) IsType

func (*OptionalType) IsType()

func (*OptionalType) Map added in v1.0.0

func (t *OptionalType) Map(memoryGauge common.MemoryGauge, typeParamMap map[*TypeParameter]*TypeParameter, f func(Type) Type) Type

func (*OptionalType) QualifiedString

func (t *OptionalType) QualifiedString() string

func (*OptionalType) Resolve

func (t *OptionalType) Resolve(typeArguments *TypeParameterTypeOrderedMap) Type

func (*OptionalType) RewriteWithIntersectionTypes added in v1.0.0

func (t *OptionalType) RewriteWithIntersectionTypes() (Type, bool)

func (*OptionalType) String

func (t *OptionalType) String() string

func (*OptionalType) SupportedEntitlements added in v1.0.0

func (t *OptionalType) SupportedEntitlements() *EntitlementSet

func (*OptionalType) Tag added in v0.24.0

func (t *OptionalType) Tag() TypeTag

func (*OptionalType) TypeAnnotationState

func (t *OptionalType) TypeAnnotationState() TypeAnnotationState

func (*OptionalType) Unify

func (t *OptionalType) Unify(
	other Type,
	typeParameters *TypeParameterTypeOrderedMap,
	report func(err error),
	memoryGauge common.MemoryGauge,
	outerRange ast.HasPosition,
) bool

type Origin

type Origin struct {
	Type            Type
	StartPos        *ast.Position
	EndPos          *ast.Position
	DocString       string
	Occurrences     []ast.Range
	DeclarationKind common.DeclarationKind
}

type Parameter

type Parameter struct {
	TypeAnnotation  TypeAnnotation
	DefaultArgument Type
	Label           string
	Identifier      string
}

func (Parameter) EffectiveArgumentLabel

func (p Parameter) EffectiveArgumentLabel() string

EffectiveArgumentLabel returns the effective argument label that an argument in a call must use: If no argument label is declared for parameter, the parameter name is used as the argument label

func (Parameter) QualifiedString

func (p Parameter) QualifiedString() string

func (Parameter) String

func (p Parameter) String() string

type ParameterizedType added in v0.5.0

type ParameterizedType interface {
	Type
	TypeParameters() []*TypeParameter
	Instantiate(
		memoryGauge common.MemoryGauge,
		typeArguments []Type,
		astTypeArguments []*ast.TypeAnnotation,
		report func(err error),
	) Type
	BaseType() Type
	TypeArguments() []Type
}

ParameterizedType is a type which might have type parameters

type Position

type Position struct {
	// line number, starting at 1
	Line int
	// column number, starting at 0 (byte count)
	Column int
}

func ASTToSemaPosition added in v0.7.0

func ASTToSemaPosition(position ast.Position) Position

func (Position) Compare

func (pos Position) Compare(other intervalst.Position) int

func (Position) String

func (pos Position) String() string

type PositionInfo added in v0.26.0

type PositionInfo struct {
	Occurrences         *Occurrences
	VariableOrigins     map[*Variable]*Origin
	MemberOrigins       map[Type]map[string]*Origin
	MemberAccesses      *MemberAccesses
	Ranges              *Ranges
	FunctionInvocations *FunctionInvocations
}

func NewPositionInfo added in v0.26.0

func NewPositionInfo() *PositionInfo

type PostConditionsRewrite

type PostConditionsRewrite struct {
	BeforeStatements        []ast.Statement
	RewrittenPostConditions ast.Conditions
}

type PreviousResourceInvalidationNote added in v0.28.0

type PreviousResourceInvalidationNote struct {
	ResourceInvalidation
	ast.Range
}

func (PreviousResourceInvalidationNote) Message added in v0.28.0

type PrimitiveAccess added in v1.0.0

type PrimitiveAccess ast.PrimitiveAccess

func (PrimitiveAccess) Equal added in v1.0.0

func (a PrimitiveAccess) Equal(other Access) bool

func (PrimitiveAccess) ID added in v1.0.0

func (PrimitiveAccess) ID() TypeID

func (PrimitiveAccess) IsPrimitiveAccess added in v1.0.0

func (PrimitiveAccess) IsPrimitiveAccess() bool

func (PrimitiveAccess) PermitsAccess added in v1.0.0

func (a PrimitiveAccess) PermitsAccess(otherAccess Access) bool

func (PrimitiveAccess) QualifiedString added in v1.0.0

func (a PrimitiveAccess) QualifiedString() string

func (PrimitiveAccess) String added in v1.0.0

func (a PrimitiveAccess) String() string

type PurityCheckScope added in v0.32.0

type PurityCheckScope struct {
	// whether encountering an impure operation should cause an error
	EnforcePurity   bool
	ActivationDepth int
}

type PurityError added in v0.32.0

type PurityError struct {
	ast.Range
}

func (*PurityError) Error added in v0.32.0

func (e *PurityError) Error() string

func (*PurityError) IsUserError added in v0.32.0

func (*PurityError) IsUserError()

type Range added in v0.16.0

type Range struct {
	Type            Type
	Identifier      string
	DocString       string
	DeclarationKind common.DeclarationKind
}

type Ranges added in v0.16.0

type Ranges struct {
	// contains filtered or unexported fields
}

func NewRanges added in v0.16.0

func NewRanges() *Ranges

func (*Ranges) All added in v0.16.0

func (r *Ranges) All() []Range

func (*Ranges) FindAll added in v0.17.0

func (r *Ranges) FindAll(pos Position) []Range

func (*Ranges) Put added in v0.16.0

func (r *Ranges) Put(startPos, endPos ast.Position, ra Range)

type ReadOnlyTargetAssignmentError

type ReadOnlyTargetAssignmentError struct {
	ast.Range
}

func (*ReadOnlyTargetAssignmentError) Error

func (*ReadOnlyTargetAssignmentError) IsUserError added in v0.25.0

func (*ReadOnlyTargetAssignmentError) IsUserError()

type RedeclarationError

type RedeclarationError struct {
	PreviousPos *ast.Position
	Name        string
	Pos         ast.Position
	Kind        common.DeclarationKind
}

func (*RedeclarationError) EndPosition

func (e *RedeclarationError) EndPosition(memoryGauge common.MemoryGauge) ast.Position

func (*RedeclarationError) Error

func (e *RedeclarationError) Error() string

func (*RedeclarationError) ErrorNotes

func (e *RedeclarationError) ErrorNotes() []errors.ErrorNote

func (*RedeclarationError) IsUserError added in v0.25.0

func (*RedeclarationError) IsUserError()

func (*RedeclarationError) StartPosition

func (e *RedeclarationError) StartPosition() ast.Position

type RedeclarationNote

type RedeclarationNote struct {
	ast.Range
}

func (RedeclarationNote) Message

func (n RedeclarationNote) Message() string

type ReferenceToAnOptionalError added in v1.0.0

type ReferenceToAnOptionalError struct {
	ReferencedOptionalType *OptionalType
	ast.Range
}

func (*ReferenceToAnOptionalError) Error added in v1.0.0

func (*ReferenceToAnOptionalError) IsUserError added in v1.0.0

func (*ReferenceToAnOptionalError) IsUserError()

func (*ReferenceToAnOptionalError) SecondaryError added in v1.0.0

func (e *ReferenceToAnOptionalError) SecondaryError() string

type ReferenceType

type ReferenceType struct {
	Type          Type
	Authorization Access
}

ReferenceType represents the reference to a value

func MaybeReferenceType added in v1.0.0

func MaybeReferenceType(typ Type) (*ReferenceType, bool)

func NewReferenceType added in v0.24.0

func NewReferenceType(
	memoryGauge common.MemoryGauge,
	authorization Access,
	typ Type,
) *ReferenceType

func (*ReferenceType) AllowsValueIndexingAssignment added in v0.7.0

func (t *ReferenceType) AllowsValueIndexingAssignment() bool

func (*ReferenceType) CheckInstantiated added in v1.0.0

func (t *ReferenceType) CheckInstantiated(pos ast.HasPosition, memoryGauge common.MemoryGauge, report func(err error))

func (*ReferenceType) ContainFieldsOrElements added in v1.0.0

func (*ReferenceType) ContainFieldsOrElements() bool

func (*ReferenceType) ElementType

func (t *ReferenceType) ElementType(isAssignment bool) Type

func (*ReferenceType) Equal

func (t *ReferenceType) Equal(other Type) bool

func (*ReferenceType) GetMembers added in v0.7.0

func (t *ReferenceType) GetMembers() map[string]MemberResolver

func (*ReferenceType) ID

func (t *ReferenceType) ID() TypeID

func (*ReferenceType) IndexingType

func (t *ReferenceType) IndexingType() Type

func (*ReferenceType) IsComparable added in v0.39.0

func (*ReferenceType) IsComparable() bool

func (*ReferenceType) IsEquatable added in v0.7.0

func (*ReferenceType) IsEquatable() bool

func (*ReferenceType) IsExportable added in v0.30.0

func (t *ReferenceType) IsExportable(_ map[*Member]bool) bool

func (*ReferenceType) IsImportable added in v0.17.0

func (t *ReferenceType) IsImportable(_ map[*Member]bool) bool

func (*ReferenceType) IsInvalidType

func (t *ReferenceType) IsInvalidType() bool

func (*ReferenceType) IsOrContainsReferenceType added in v1.0.0

func (*ReferenceType) IsOrContainsReferenceType() bool

func (*ReferenceType) IsPrimitiveType added in v1.0.0

func (t *ReferenceType) IsPrimitiveType() bool

func (*ReferenceType) IsResourceType

func (t *ReferenceType) IsResourceType() bool

func (*ReferenceType) IsStorable added in v0.5.0

func (t *ReferenceType) IsStorable(_ map[*Member]bool) bool

func (*ReferenceType) IsType

func (*ReferenceType) IsType()

func (*ReferenceType) IsValidIndexingType added in v0.36.0

func (t *ReferenceType) IsValidIndexingType(ty Type) bool

func (*ReferenceType) Map added in v1.0.0

func (t *ReferenceType) Map(gauge common.MemoryGauge, typeParamMap map[*TypeParameter]*TypeParameter, f func(Type) Type) Type

func (*ReferenceType) QualifiedString

func (t *ReferenceType) QualifiedString() string

func (*ReferenceType) Resolve

func (t *ReferenceType) Resolve(typeArguments *TypeParameterTypeOrderedMap) Type

func (*ReferenceType) RewriteWithIntersectionTypes added in v1.0.0

func (t *ReferenceType) RewriteWithIntersectionTypes() (Type, bool)

func (*ReferenceType) String

func (t *ReferenceType) String() string

func (*ReferenceType) Tag added in v0.24.0

func (t *ReferenceType) Tag() TypeTag

func (*ReferenceType) TypeAnnotationState

func (t *ReferenceType) TypeAnnotationState() TypeAnnotationState

func (*ReferenceType) TypeIndexingElementType added in v0.36.0

func (t *ReferenceType) TypeIndexingElementType(indexingType Type, _ func() ast.Range) (Type, error)

func (*ReferenceType) Unify

func (t *ReferenceType) Unify(
	other Type,
	typeParameters *TypeParameterTypeOrderedMap,
	report func(err error),
	memoryGauge common.MemoryGauge,
	outerRange ast.HasPosition,
) bool

type ResolvedLocation added in v0.10.0

type ResolvedLocation struct {
	Location    common.Location
	Identifiers []ast.Identifier
}

type Resource added in v0.25.0

type Resource struct {
	Variable *Variable
	Member   *Member
}

A Resource is a variable or a member

type ResourceCapturingError

type ResourceCapturingError struct {
	Name string
	Pos  ast.Position
}

func (*ResourceCapturingError) EndPosition

func (e *ResourceCapturingError) EndPosition(memoryGauge common.MemoryGauge) ast.Position

func (*ResourceCapturingError) Error

func (e *ResourceCapturingError) Error() string

func (*ResourceCapturingError) IsUserError added in v0.25.0

func (*ResourceCapturingError) IsUserError()

func (*ResourceCapturingError) StartPosition

func (e *ResourceCapturingError) StartPosition() ast.Position

type ResourceFieldNotInvalidatedError

type ResourceFieldNotInvalidatedError struct {
	Type      Type
	FieldName string
	Pos       ast.Position
}

func (*ResourceFieldNotInvalidatedError) EndPosition

func (e *ResourceFieldNotInvalidatedError) EndPosition(memoryGauge common.MemoryGauge) ast.Position

func (*ResourceFieldNotInvalidatedError) Error

func (*ResourceFieldNotInvalidatedError) IsUserError added in v0.25.0

func (*ResourceFieldNotInvalidatedError) IsUserError()

func (*ResourceFieldNotInvalidatedError) SecondaryError

func (e *ResourceFieldNotInvalidatedError) SecondaryError() string

func (*ResourceFieldNotInvalidatedError) StartPosition

func (e *ResourceFieldNotInvalidatedError) StartPosition() ast.Position

type ResourceInfo

type ResourceInfo struct {
	Parent *ResourceInfo
	// contains filtered or unexported fields
}

func (*ResourceInfo) Clone added in v0.13.0

func (ris *ResourceInfo) Clone() ResourceInfo

Clone returns a new child resource invalidation set that contains all entries of this parent set. Changes to the returned set will only be applied in the returned set, not the parent.

func (ResourceInfo) DefinitivelyInvalidated

func (ris ResourceInfo) DefinitivelyInvalidated() bool

func (*ResourceInfo) DeleteLocally added in v0.28.0

func (ris *ResourceInfo) DeleteLocally(invalidation ResourceInvalidation)

DeleteLocally removes the given resource invalidation from this current set.

NOTE: the invalidation still might exist in a parent afterwards, i.e. call to Contains might still return true!

func (ResourceInfo) Invalidation added in v0.28.0

func (ris ResourceInfo) Invalidation() *ResourceInvalidation

func (*ResourceInfo) MaybeRecordInvalidation added in v0.28.0

func (ris *ResourceInfo) MaybeRecordInvalidation(invalidation ResourceInvalidation) ResourceInvalidation

MaybeRecordInvalidation records the given resource invalidation, if no invalidation has yet been recorded for the given resource.

type ResourceInvalidation

type ResourceInvalidation struct {
	Kind     ResourceInvalidationKind
	StartPos ast.Position
	EndPos   ast.Position
}

type ResourceInvalidationKind

type ResourceInvalidationKind uint
const (
	ResourceInvalidationKindUnknown ResourceInvalidationKind = iota
	ResourceInvalidationKindMoveDefinite
	ResourceInvalidationKindMovePotential
	ResourceInvalidationKindMoveTemporary
	ResourceInvalidationKindDestroyDefinite
	ResourceInvalidationKindDestroyPotential
)

func (ResourceInvalidationKind) AsPotential added in v0.28.0

func (ResourceInvalidationKind) CoarseNoun added in v0.28.0

func (i ResourceInvalidationKind) CoarseNoun() string

func (ResourceInvalidationKind) CoarsePassiveVerb added in v0.28.0

func (k ResourceInvalidationKind) CoarsePassiveVerb() string

func (ResourceInvalidationKind) DetailedNoun added in v0.28.0

func (k ResourceInvalidationKind) DetailedNoun() string

func (ResourceInvalidationKind) IsDefinite added in v0.5.0

func (k ResourceInvalidationKind) IsDefinite() bool

func (ResourceInvalidationKind) String

func (i ResourceInvalidationKind) String() string

type ResourceLossError

type ResourceLossError struct {
	ast.Range
}

func (*ResourceLossError) Error

func (e *ResourceLossError) Error() string

func (*ResourceLossError) IsUserError added in v0.25.0

func (*ResourceLossError) IsUserError()

type ResourceMethodBindingError

type ResourceMethodBindingError struct {
	ast.Range
}

func (*ResourceMethodBindingError) Error

func (*ResourceMethodBindingError) IsUserError added in v0.25.0

func (*ResourceMethodBindingError) IsUserError()

type ResourceUseAfterInvalidationError

type ResourceUseAfterInvalidationError struct {
	Invalidation ResourceInvalidation
	ast.Range
}

func (*ResourceUseAfterInvalidationError) Error

func (*ResourceUseAfterInvalidationError) ErrorNotes

func (*ResourceUseAfterInvalidationError) IsUserError added in v0.25.0

func (*ResourceUseAfterInvalidationError) IsUserError()

func (*ResourceUseAfterInvalidationError) SecondaryError

func (e *ResourceUseAfterInvalidationError) SecondaryError() string

type Resources

type Resources struct {
	// contains filtered or unexported fields
}

Resources is a map which contains invalidation info for resources.

func NewResources added in v0.13.0

func NewResources() *Resources

func (*Resources) Clone

func (ris *Resources) Clone() *Resources

func (*Resources) ForEach added in v0.10.6

func (ris *Resources) ForEach(f func(resource Resource, info ResourceInfo))

func (*Resources) Get

func (ris *Resources) Get(resource Resource) ResourceInfo

func (*Resources) MaybeRecordInvalidation added in v0.28.0

func (ris *Resources) MaybeRecordInvalidation(resource Resource, invalidation ResourceInvalidation)

MaybeRecordInvalidation records the given resource invalidation, if no invalidation has yet been recorded for the given resource.

func (*Resources) MergeBranches

func (ris *Resources) MergeBranches(
	thenResources *Resources,
	thenReturnInfo *ReturnInfo,
	elseResources *Resources,
	elseReturnInfo *ReturnInfo,
)

MergeBranches merges the given resources from two branches into these resources. Invalidations occurring in both branches are considered definitive, other new invalidations are only considered potential. The else resources are optional.

func (*Resources) Reclaim added in v0.29.0

func (ris *Resources) Reclaim()

func (*Resources) RemoveTemporaryMoveInvalidation added in v0.13.0

func (ris *Resources) RemoveTemporaryMoveInvalidation(resource Resource, invalidation ResourceInvalidation)

RemoveTemporaryMoveInvalidation removes the given invalidation from the set of invalidations for the given resource.

func (*Resources) Size

func (ris *Resources) Size() int

func (*Resources) String

func (ris *Resources) String() string

type ReturnInfo

type ReturnInfo struct {
	// JumpOffsets contains the offsets of all jumps
	// (break or continue statements), potential or definite.
	//
	// If non-empty, indicates that (the branch of) the function
	// contains a potential break or continue statement
	JumpOffsets *persistent.OrderedSet[int]
	// MaybeReturned indicates that (the branch of) the function
	// contains a potentially taken return statement
	MaybeReturned bool
	// DefinitelyReturned indicates that (the branch of) the function
	// contains a definite return statement
	DefinitelyReturned bool
	// DefinitelyHalted indicates that (the branch of) the function
	// contains a definite halt (a function call with a Never return type)
	DefinitelyHalted bool
	// DefinitelyExited indicates that (the branch of)
	// the function either contains a definite return statement,
	// contains a definite halt (a function call with a Never return type),
	// or both.
	//
	// NOTE: this is NOT the same DefinitelyReturned || DefinitelyHalted:
	// For example, for the following program:
	//
	//   if ... {
	//       return
	//
	//       // DefinitelyReturned = true
	//	     // DefinitelyHalted = false
	//	     // DefinitelyExited = true
	//   } else {
	//       panic(...)
	//
	//       // DefinitelyReturned = false
	//	     // DefinitelyHalted = true
	//	     // DefinitelyExited = true
	//   }
	//
	//   // DefinitelyReturned = false
	//   // DefinitelyHalted = false
	//   // DefinitelyExited = true
	DefinitelyExited bool
	// DefinitelyJumped indicates that (the branch of) the function
	// contains a definite break or continue statement
	DefinitelyJumped bool
}

ReturnInfo tracks control-flow information

func NewReturnInfo added in v0.28.0

func NewReturnInfo() *ReturnInfo

func (*ReturnInfo) AddJumpOffset added in v0.28.0

func (ri *ReturnInfo) AddJumpOffset(offset int)

func (*ReturnInfo) Clone

func (ri *ReturnInfo) Clone() *ReturnInfo

func (*ReturnInfo) IsUnreachable added in v0.21.0

func (ri *ReturnInfo) IsUnreachable() bool

func (*ReturnInfo) MaybeJumped added in v0.25.1

func (ri *ReturnInfo) MaybeJumped() bool

func (*ReturnInfo) MergeBranches

func (ri *ReturnInfo) MergeBranches(thenReturnInfo *ReturnInfo, elseReturnInfo *ReturnInfo)

func (*ReturnInfo) MergePotentiallyUnevaluated added in v0.25.1

func (ri *ReturnInfo) MergePotentiallyUnevaluated(temporaryReturnInfo *ReturnInfo)

func (*ReturnInfo) WithNewJumpTarget added in v0.28.0

func (ri *ReturnInfo) WithNewJumpTarget(f func())

type ReturnStatementTypes added in v0.26.0

type ReturnStatementTypes struct {
	ValueType  Type
	ReturnType Type
}

type RuntimeCastTypes added in v0.26.0

type RuntimeCastTypes struct {
	Left  Type
	Right Type
}

type RuntimeTypeConstructor added in v0.24.0

type RuntimeTypeConstructor struct {
	Name      string
	Value     *FunctionType
	DocString string
}

type SaturatingArithmeticSupport added in v0.40.0

type SaturatingArithmeticSupport struct {
	Add      bool
	Subtract bool
	Multiply bool
	Divide   bool
}

type SaturatingArithmeticType added in v0.15.0

type SaturatingArithmeticType interface {
	Type
	SupportsSaturatingAdd() bool
	SupportsSaturatingSubtract() bool
	SupportsSaturatingMultiply() bool
	SupportsSaturatingDivide() bool
}

SaturatingArithmeticType is a type that supports saturating arithmetic functions

type SemanticError

type SemanticError interface {
	errors.UserError
	ast.HasPosition
	// contains filtered or unexported methods
}

type SignatureAlgorithm added in v0.14.0

type SignatureAlgorithm uint8
const (
	SignatureAlgorithmUnknown SignatureAlgorithm = iota
	SignatureAlgorithmECDSA_P256
	SignatureAlgorithmECDSA_secp256k1
	SignatureAlgorithmBLS_BLS12_381
)
  • Existing stored values use these raw values and should not change

NOTE: only add new algorithms, do *NOT* change existing items, reuse raw values for other items, swap the order, etc.

Existing stored values use these raw values and should not change

IMPORTANT: update SignatureAlgorithms

func (SignatureAlgorithm) DocString added in v0.14.0

func (algo SignatureAlgorithm) DocString() string

func (SignatureAlgorithm) Name added in v0.14.0

func (algo SignatureAlgorithm) Name() string

Name returns the string representation of this signing algorithm.

func (SignatureAlgorithm) RawValue added in v0.14.0

func (algo SignatureAlgorithm) RawValue() uint8

func (SignatureAlgorithm) String added in v0.14.0

func (i SignatureAlgorithm) String() string

type SimpleType added in v0.13.5

type SimpleType struct {
	ValueIndexingInfo ValueIndexingInfo
	NestedTypes       *StringTypeOrderedMap

	Members       func(*SimpleType) map[string]MemberResolver
	QualifiedName string
	TypeID        TypeID
	Name          string
	TypeTag       TypeTag

	Importable    bool
	Exportable    bool
	Equatable     bool
	Comparable    bool
	Storable      bool
	Primitive     bool
	IsResource    bool
	ContainFields bool
	// contains filtered or unexported fields
}

SimpleType represents a simple nominal type.

func (*SimpleType) AllowsValueIndexingAssignment added in v0.13.5

func (t *SimpleType) AllowsValueIndexingAssignment() bool

func (*SimpleType) CheckInstantiated added in v1.0.0

func (t *SimpleType) CheckInstantiated(_ ast.HasPosition, _ common.MemoryGauge, _ func(err error))

func (*SimpleType) CompositeKind added in v0.36.0

func (t *SimpleType) CompositeKind() common.CompositeKind

func (*SimpleType) ContainFieldsOrElements added in v1.0.0

func (t *SimpleType) ContainFieldsOrElements() bool

func (*SimpleType) ElementType added in v0.13.5

func (t *SimpleType) ElementType(isAssignment bool) Type

func (*SimpleType) Equal added in v0.13.5

func (t *SimpleType) Equal(other Type) bool

func (*SimpleType) GetMembers added in v0.13.5

func (t *SimpleType) GetMembers() map[string]MemberResolver

func (*SimpleType) GetNestedTypes added in v0.13.5

func (t *SimpleType) GetNestedTypes() *StringTypeOrderedMap

func (*SimpleType) ID added in v0.13.5

func (t *SimpleType) ID() TypeID

func (*SimpleType) IndexingType added in v0.13.5

func (t *SimpleType) IndexingType() Type

func (*SimpleType) IsComparable added in v0.39.0

func (t *SimpleType) IsComparable() bool

func (*SimpleType) IsContainerType added in v0.20.3

func (t *SimpleType) IsContainerType() bool

func (*SimpleType) IsEquatable added in v0.13.5

func (t *SimpleType) IsEquatable() bool

func (*SimpleType) IsExportable added in v0.30.0

func (t *SimpleType) IsExportable(_ map[*Member]bool) bool

func (*SimpleType) IsImportable added in v0.17.0

func (t *SimpleType) IsImportable(_ map[*Member]bool) bool

func (*SimpleType) IsInvalidType added in v0.13.5

func (t *SimpleType) IsInvalidType() bool

func (*SimpleType) IsOrContainsReferenceType added in v1.0.0

func (*SimpleType) IsOrContainsReferenceType() bool

func (*SimpleType) IsPrimitiveType added in v1.0.0

func (t *SimpleType) IsPrimitiveType() bool

func (*SimpleType) IsResourceType added in v0.13.5

func (t *SimpleType) IsResourceType() bool

func (*SimpleType) IsStorable added in v0.13.5

func (t *SimpleType) IsStorable(_ map[*Member]bool) bool

func (*SimpleType) IsType added in v0.13.5

func (*SimpleType) IsType()

func (*SimpleType) Map added in v1.0.0

func (t *SimpleType) Map(_ common.MemoryGauge, _ map[*TypeParameter]*TypeParameter, f func(Type) Type) Type

func (*SimpleType) QualifiedString added in v0.13.5

func (t *SimpleType) QualifiedString() string

func (*SimpleType) Resolve added in v0.13.5

func (*SimpleType) RewriteWithIntersectionTypes added in v1.0.0

func (t *SimpleType) RewriteWithIntersectionTypes() (Type, bool)

func (*SimpleType) String added in v0.13.5

func (t *SimpleType) String() string

func (*SimpleType) Tag added in v0.24.0

func (t *SimpleType) Tag() TypeTag

func (*SimpleType) TypeAnnotationState added in v0.13.5

func (*SimpleType) TypeAnnotationState() TypeAnnotationState

func (*SimpleType) Unify added in v0.13.5

type SpecialFunctionDefaultImplementationError added in v0.26.0

type SpecialFunctionDefaultImplementationError struct {
	Container  ast.Declaration
	Identifier *ast.Identifier
	KindName   string
}

SpecialFunctionDefaultImplementationError

func (*SpecialFunctionDefaultImplementationError) EndPosition added in v0.26.0

func (*SpecialFunctionDefaultImplementationError) Error added in v0.26.0

func (*SpecialFunctionDefaultImplementationError) IsUserError added in v0.26.0

func (*SpecialFunctionDefaultImplementationError) StartPosition added in v0.26.0

type StringImportElementOrderedMap added in v0.13.0

type StringImportElementOrderedMap = orderedmap.OrderedMap[string, ImportElement]

type StringMemberOrderedMap added in v0.13.0

type StringMemberOrderedMap = orderedmap.OrderedMap[string, *Member]

func MembersAsMap added in v0.39.0

func MembersAsMap(members []*Member) *StringMemberOrderedMap

type StringTypeOrderedMap added in v0.13.0

type StringTypeOrderedMap = orderedmap.OrderedMap[string, Type]

type StringVariableOrderedMap added in v0.13.0

type StringVariableOrderedMap = orderedmap.OrderedMap[string, *Variable]

type SwapStatementTypes added in v0.26.0

type SwapStatementTypes struct {
	LeftType  Type
	RightType Type
}

type SwitchDefaultPositionError added in v0.10.0

type SwitchDefaultPositionError struct {
	ast.Range
}

func (*SwitchDefaultPositionError) Error added in v0.10.0

func (*SwitchDefaultPositionError) IsUserError added in v0.25.0

func (*SwitchDefaultPositionError) IsUserError()

type TransactionMissingPrepareError

type TransactionMissingPrepareError struct {
	FirstFieldName string
	FirstFieldPos  ast.Position
}

func (*TransactionMissingPrepareError) EndPosition

func (e *TransactionMissingPrepareError) EndPosition(memoryGauge common.MemoryGauge) ast.Position

func (*TransactionMissingPrepareError) Error

func (*TransactionMissingPrepareError) IsUserError added in v0.25.0

func (*TransactionMissingPrepareError) IsUserError()

func (*TransactionMissingPrepareError) StartPosition

func (e *TransactionMissingPrepareError) StartPosition() ast.Position

type TransactionType

type TransactionType struct {
	Fields            []string
	PrepareParameters []Parameter
	Parameters        []Parameter
	Members           *StringMemberOrderedMap
	// contains filtered or unexported fields
}

func (*TransactionType) CheckInstantiated added in v1.0.0

func (t *TransactionType) CheckInstantiated(pos ast.HasPosition, memoryGauge common.MemoryGauge, report func(err error))

func (*TransactionType) ContainFieldsOrElements added in v1.0.0

func (*TransactionType) ContainFieldsOrElements() bool

func (*TransactionType) EntryPointFunctionType

func (t *TransactionType) EntryPointFunctionType() *FunctionType

func (*TransactionType) Equal

func (*TransactionType) Equal(other Type) bool

func (*TransactionType) ExecuteFunctionType

func (*TransactionType) ExecuteFunctionType() *FunctionType

func (*TransactionType) GetMembers added in v0.7.0

func (t *TransactionType) GetMembers() map[string]MemberResolver

func (*TransactionType) ID

func (*TransactionType) ID() TypeID

func (*TransactionType) IsComparable added in v0.39.0

func (*TransactionType) IsComparable() bool

func (*TransactionType) IsEquatable added in v0.7.0

func (*TransactionType) IsEquatable() bool

func (*TransactionType) IsExportable added in v0.30.0

func (*TransactionType) IsExportable(_ map[*Member]bool) bool

func (*TransactionType) IsImportable added in v0.17.0

func (t *TransactionType) IsImportable(_ map[*Member]bool) bool

func (*TransactionType) IsInvalidType

func (*TransactionType) IsInvalidType() bool

func (*TransactionType) IsOrContainsReferenceType added in v1.0.0

func (*TransactionType) IsOrContainsReferenceType() bool

func (*TransactionType) IsPrimitiveType added in v1.0.0

func (*TransactionType) IsPrimitiveType() bool

func (*TransactionType) IsResourceType

func (*TransactionType) IsResourceType() bool

func (*TransactionType) IsStorable added in v0.5.0

func (*TransactionType) IsStorable(_ map[*Member]bool) bool

func (*TransactionType) IsType

func (*TransactionType) IsType()

func (*TransactionType) Map added in v1.0.0

func (*TransactionType) PrepareFunctionType

func (t *TransactionType) PrepareFunctionType() *FunctionType

func (*TransactionType) QualifiedString

func (*TransactionType) QualifiedString() string

func (*TransactionType) Resolve

func (*TransactionType) RewriteWithIntersectionTypes added in v1.0.0

func (t *TransactionType) RewriteWithIntersectionTypes() (Type, bool)

func (*TransactionType) String

func (*TransactionType) String() string

func (*TransactionType) Tag added in v0.24.0

func (t *TransactionType) Tag() TypeTag

func (*TransactionType) TypeAnnotationState

func (*TransactionType) TypeAnnotationState() TypeAnnotationState

func (*TransactionType) Unify

type Type

type Type interface {
	IsType()
	ID() TypeID
	Tag() TypeTag
	String() string
	QualifiedString() string
	Equal(other Type) bool

	// IsPrimitiveType returns true if the type is itself a primitive,
	// Note that the container of a primitive type (e.g. optionals, arrays, dictionaries, etc.)
	// are not a primitive.
	IsPrimitiveType() bool

	// IsResourceType returns true if the type is itself a resource (a `CompositeType` with resource kind),
	// or it contains a resource type (e.g. for optionals, arrays, dictionaries, etc.)
	IsResourceType() bool

	// IsInvalidType returns true if the type is itself the invalid type (see `InvalidType`),
	// or it contains an invalid type (e.g. for optionals, arrays, dictionaries, etc.)
	IsInvalidType() bool

	// IsOrContainsReferenceType returns true if the type is itself a reference type,
	// or it contains a reference type (e.g. for optionals, arrays, dictionaries, etc.)
	IsOrContainsReferenceType() bool

	// IsStorable returns true if the type is allowed to be a stored,
	// e.g. in a field of a composite type.
	//
	// The check if the type is storable is recursive,
	// the results parameter prevents cycles:
	// it is checked at the start of the recursively called function,
	// and pre-set before a recursive call.
	IsStorable(results map[*Member]bool) bool

	// IsExportable returns true if a value of this type can be exported.
	//
	// The check if the type is exportable is recursive,
	// the results parameter prevents cycles:
	// it is checked at the start of the recursively called function,
	// and pre-set before a recursive call.
	IsExportable(results map[*Member]bool) bool

	// IsImportable returns true if values of the type can be imported to a program as arguments
	IsImportable(results map[*Member]bool) bool

	// IsEquatable returns true if values of the type can be equated
	IsEquatable() bool

	// IsComparable returns true if values of the type can be compared
	IsComparable() bool

	// ContainFieldsOrElements returns true if value of the type can have nested values (fields or elements).
	// This notion is to indicate that a type can be used to access its nested values using
	// either index-expression or member-expression. e.g. `foo.bar` or `foo[bar]`.
	// This is used to determine if a field/element of this type should be returning a reference or not.
	//
	// Only a subset of types has this characteristic. e.g:
	//  - Composites
	//  - Interfaces
	//  - Arrays (Variable/Constant sized)
	//  - Dictionaries
	//  - Restricted types
	//  - Optionals of the above.
	//  - Then there are also built-in simple types, like StorageCapabilityControllerType, BlockType, etc.
	//    where the type is implemented as a simple type, but they also have fields.
	//
	// This is different from the existing  `ValueIndexableType` in the sense that it is also implemented by simple types
	// but not all simple types are indexable.
	// On the other-hand, some indexable types (e.g. String) shouldn't be treated/returned as references.
	//
	ContainFieldsOrElements() bool

	TypeAnnotationState() TypeAnnotationState
	RewriteWithIntersectionTypes() (result Type, rewritten bool)

	// Unify attempts to unify the given type with this type, i.e., resolve type parameters
	// in generic types (see `GenericType`) using the given type parameters.
	//
	// For a generic type, unification assigns a given type with a type parameter.
	//
	// If the type parameter has not been previously unified with a type,
	// through an explicitly provided type argument in an invocation
	// or through a previous unification, the type parameter is assigned the given type.
	//
	// If the type parameter has already been previously unified with a type,
	// the type parameter's unified .
	//
	// The boolean return value indicates if a generic type was encountered during unification.
	// For primitives (e.g. `Int`, `String`, etc.) it would be false, as .
	// For types with nested types (e.g. optionals, arrays, and dictionaries)
	// the result is the successful unification of the inner types.
	//
	// The boolean return value does *not* indicate if unification succeeded or not.
	//
	Unify(
		other Type,
		typeParameters *TypeParameterTypeOrderedMap,
		report func(err error),
		memoryGauge common.MemoryGauge,
		outerRange ast.HasPosition,
	) bool

	// Resolve returns a type that is free of generic types (see `GenericType`),
	// i.e. it resolves the type parameters in generic types given the type parameter
	// unifications of `typeParameters`.
	//
	// If resolution fails, it returns `nil`.
	//
	Resolve(typeArguments *TypeParameterTypeOrderedMap) Type

	GetMembers() map[string]MemberResolver

	// applies `f` to all the types syntactically comprising this type.
	// i.e. `[T]` would map to `f([f(T)])`, but the internals of composite types are not
	// inspected, as they appear simply as nominal types in annotations
	Map(memoryGauge common.MemoryGauge, typeParamMap map[*TypeParameter]*TypeParameter, f func(Type) Type) Type

	CheckInstantiated(pos ast.HasPosition, memoryGauge common.MemoryGauge, report func(err error))
}

func CheckIntersectionType added in v1.0.0

func CheckIntersectionType(
	memoryGauge common.MemoryGauge,
	types []*InterfaceType,
	report func(func(*ast.IntersectionType) error),
) Type

func CheckPathLiteral added in v0.12.0

func CheckPathLiteral(
	gauge common.MemoryGauge,
	domain string,
	identifier string,
	domainRange ast.HasPosition,
	identifierRange ast.HasPosition,
) (Type, error)

func LeastCommonSuperType added in v0.24.0

func LeastCommonSuperType(types ...Type) Type

func MustInstantiate added in v0.32.0

func MustInstantiate(t ParameterizedType, typeArguments ...Type) Type

func TypeActivationNestedType added in v0.42.0

func TypeActivationNestedType(typeActivation *VariableActivation, qualifiedIdentifier string) Type

func UnwrapOptionalType

func UnwrapOptionalType(ty Type) Type

UnwrapOptionalType returns the type if it is not an optional type, or the inner-most type if it is (optional types are repeatedly unwrapped)

type TypeAnnotation

type TypeAnnotation struct {
	Type       Type
	IsResource bool
}

func NewTypeAnnotation

func NewTypeAnnotation(ty Type) TypeAnnotation

func (TypeAnnotation) Equal

func (a TypeAnnotation) Equal(other TypeAnnotation) bool

func (TypeAnnotation) Map added in v1.0.0

func (a TypeAnnotation) Map(gauge common.MemoryGauge, typeParamMap map[*TypeParameter]*TypeParameter, f func(Type) Type) TypeAnnotation

func (TypeAnnotation) QualifiedString

func (a TypeAnnotation) QualifiedString() string

func (TypeAnnotation) String

func (a TypeAnnotation) String() string

func (TypeAnnotation) TypeAnnotationState

func (a TypeAnnotation) TypeAnnotationState() TypeAnnotationState

type TypeAnnotationRequiredError added in v0.9.0

type TypeAnnotationRequiredError struct {
	Cause string
	Pos   ast.Position
}

func (*TypeAnnotationRequiredError) EndPosition added in v0.9.0

func (*TypeAnnotationRequiredError) Error added in v0.9.0

func (*TypeAnnotationRequiredError) IsUserError added in v0.25.0

func (*TypeAnnotationRequiredError) IsUserError()

func (*TypeAnnotationRequiredError) StartPosition added in v0.9.0

func (e *TypeAnnotationRequiredError) StartPosition() ast.Position

type TypeAnnotationState

type TypeAnnotationState uint
const (
	TypeAnnotationStateUnknown TypeAnnotationState = iota
	TypeAnnotationStateValid
	// Resource annotations (@) are invalid on non-resource types (e.g. @Int)
	TypeAnnotationStateInvalidResourceAnnotation
	// Resource types must have a resource annotation (@)
	TypeAnnotationStateMissingResourceAnnotation
	// Entitlement types must only appear in `access` or `auth` modifier positions
	TypeAnnotationStateDirectEntitlementTypeAnnotation
	// attachments types must never appear directly as annotations, and instead
	// should appear only in reference types: e.g. `&A` or `[&A]`
	TypeAnnotationStateDirectAttachmentTypeAnnotation
)

func (TypeAnnotationState) String

func (i TypeAnnotationState) String() string

type TypeArgumentsCheck added in v1.0.0

type TypeArgumentsCheck func(
	memoryGauge common.MemoryGauge,
	typeArguments *TypeParameterTypeOrderedMap,
	astTypeArguments []*ast.TypeAnnotation,
	invocationRange ast.HasPosition,
	report func(err error),
)

type TypeCheckFunc

type TypeCheckFunc = func() Type

type TypeDeclaration

type TypeDeclaration interface {
	TypeDeclarationName() string
	TypeDeclarationType() Type
	TypeDeclarationKind() common.DeclarationKind
	TypeDeclarationPosition() *ast.Position
}

type TypeID

type TypeID = common.TypeID

func InclusiveRangeTypeID added in v1.0.0

func InclusiveRangeTypeID(memberTypeID string) TypeID

type TypeIDOrderedSet added in v1.0.0

type TypeIDOrderedSet = orderedmap.OrderedMap[common.TypeID, struct{}]

type TypeIndexableType added in v0.36.0

type TypeIndexableType interface {
	Type

	IsValidIndexingType(indexingType Type) bool
	TypeIndexingElementType(indexingType Type, astRange func() ast.Range) (Type, error)
	// contains filtered or unexported methods
}

TypeIndexableType is a type which can be indexed into using a type

type TypeMismatchError

type TypeMismatchError struct {
	ExpectedType Type
	ActualType   Type
	Expression   ast.Expression
	ast.Range
}

func (*TypeMismatchError) Error

func (e *TypeMismatchError) Error() string

func (*TypeMismatchError) IsUserError added in v0.25.0

func (*TypeMismatchError) IsUserError()

func (*TypeMismatchError) SecondaryError

func (e *TypeMismatchError) SecondaryError() string

type TypeMismatchWithDescriptionError

type TypeMismatchWithDescriptionError struct {
	ActualType              Type
	ExpectedTypeDescription string
	ast.Range
}

func (*TypeMismatchWithDescriptionError) Error

func (*TypeMismatchWithDescriptionError) IsUserError added in v0.25.0

func (*TypeMismatchWithDescriptionError) IsUserError()

func (*TypeMismatchWithDescriptionError) SecondaryError

func (e *TypeMismatchWithDescriptionError) SecondaryError() string

type TypeParameter

type TypeParameter struct {
	TypeBound Type
	Name      string
	Optional  bool
}

func (TypeParameter) Equal

func (p TypeParameter) Equal(other *TypeParameter) bool

func (TypeParameter) QualifiedString

func (p TypeParameter) QualifiedString() string

func (TypeParameter) String

func (p TypeParameter) String() string

type TypeParameterTypeInferenceError

type TypeParameterTypeInferenceError struct {
	Name string
	ast.Range
}

func (*TypeParameterTypeInferenceError) Error

func (*TypeParameterTypeInferenceError) IsUserError added in v0.25.0

func (*TypeParameterTypeInferenceError) IsUserError()

type TypeParameterTypeMismatchError

type TypeParameterTypeMismatchError struct {
	TypeParameter *TypeParameter
	ExpectedType  Type
	ActualType    Type
	ast.Range
}

func (*TypeParameterTypeMismatchError) Error

func (*TypeParameterTypeMismatchError) IsUserError added in v0.25.0

func (*TypeParameterTypeMismatchError) IsUserError()

func (*TypeParameterTypeMismatchError) SecondaryError

func (e *TypeParameterTypeMismatchError) SecondaryError() string

type TypeParameterTypeOrderedMap added in v0.13.0

type TypeParameterTypeOrderedMap = orderedmap.OrderedMap[*TypeParameter, Type]

type TypeTag added in v0.24.0

type TypeTag struct {
	// contains filtered or unexported fields
}

TypeTag is a bitmask representation for types. Each type has a unique dedicated bit/bit-pattern in the bitmask. The mask consist of two sections: `lowerMask` and the `upperMask`. Each section can represent 64-types.

func (TypeTag) And added in v0.24.0

func (t TypeTag) And(tag TypeTag) TypeTag

func (TypeTag) BelongsTo added in v0.24.0

func (t TypeTag) BelongsTo(typeTag TypeTag) bool

func (TypeTag) ContainsAny added in v0.24.0

func (t TypeTag) ContainsAny(typeTags ...TypeTag) bool

func (TypeTag) Equals added in v0.24.0

func (t TypeTag) Equals(tag TypeTag) bool

func (TypeTag) Not added in v0.24.0

func (t TypeTag) Not() TypeTag

func (TypeTag) Or added in v0.24.0

func (t TypeTag) Or(tag TypeTag) TypeTag

type UnauthorizedReferenceAssignmentError added in v1.0.0

type UnauthorizedReferenceAssignmentError struct {
	RequiredAccess [2]Access
	FoundAccess    Access
	ast.Range
}

func (*UnauthorizedReferenceAssignmentError) Error added in v1.0.0

func (*UnauthorizedReferenceAssignmentError) IsUserError added in v1.0.0

func (*UnauthorizedReferenceAssignmentError) IsUserError()

func (*UnauthorizedReferenceAssignmentError) SecondaryError added in v1.0.0

func (e *UnauthorizedReferenceAssignmentError) SecondaryError() string

type UninitializedFieldAccessError

type UninitializedFieldAccessError struct {
	Name string
	Pos  ast.Position
}

func (*UninitializedFieldAccessError) EndPosition

func (e *UninitializedFieldAccessError) EndPosition(memoryGauge common.MemoryGauge) ast.Position

func (*UninitializedFieldAccessError) Error

func (*UninitializedFieldAccessError) IsUserError added in v0.25.0

func (*UninitializedFieldAccessError) IsUserError()

func (*UninitializedFieldAccessError) StartPosition

func (e *UninitializedFieldAccessError) StartPosition() ast.Position

type UninitializedUseError

type UninitializedUseError struct {
	Name string
	Pos  ast.Position
}

func (*UninitializedUseError) EndPosition

func (e *UninitializedUseError) EndPosition(memoryGauge common.MemoryGauge) ast.Position

func (*UninitializedUseError) Error

func (e *UninitializedUseError) Error() string

func (*UninitializedUseError) IsUserError added in v0.25.0

func (*UninitializedUseError) IsUserError()

func (*UninitializedUseError) StartPosition

func (e *UninitializedUseError) StartPosition() ast.Position

type UnknownSpecialFunctionError

type UnknownSpecialFunctionError struct {
	Pos ast.Position
}

func (*UnknownSpecialFunctionError) EndPosition

func (*UnknownSpecialFunctionError) Error

func (*UnknownSpecialFunctionError) IsUserError added in v0.25.0

func (*UnknownSpecialFunctionError) IsUserError()

func (*UnknownSpecialFunctionError) StartPosition

func (e *UnknownSpecialFunctionError) StartPosition() ast.Position

type UnparameterizedTypeInstantiationError added in v0.5.0

type UnparameterizedTypeInstantiationError struct {
	ActualTypeArgumentCount int
	ast.Range
}

func (*UnparameterizedTypeInstantiationError) Error added in v0.5.0

func (*UnparameterizedTypeInstantiationError) IsUserError added in v0.25.0

func (*UnparameterizedTypeInstantiationError) SecondaryError added in v0.5.0

func (e *UnparameterizedTypeInstantiationError) SecondaryError() string

type UnreachableStatementError

type UnreachableStatementError struct {
	ast.Range
}

func (*UnreachableStatementError) Error

func (e *UnreachableStatementError) Error() string

func (*UnreachableStatementError) IsUserError added in v0.25.0

func (*UnreachableStatementError) IsUserError()

func (*UnreachableStatementError) SecondaryError added in v0.31.0

func (e *UnreachableStatementError) SecondaryError() string

type UnrepresentableEntitlementMapOutputError added in v1.0.0

type UnrepresentableEntitlementMapOutputError struct {
	Input EntitlementSetAccess
	Map   *EntitlementMapType
	ast.Range
}

UnrepresentableEntitlementMapOutputError

func (*UnrepresentableEntitlementMapOutputError) EndPosition added in v1.0.0

func (*UnrepresentableEntitlementMapOutputError) Error added in v1.0.0

func (*UnrepresentableEntitlementMapOutputError) IsUserError added in v1.0.0

func (*UnrepresentableEntitlementMapOutputError) SecondaryError added in v1.0.0

func (*UnrepresentableEntitlementMapOutputError) StartPosition added in v1.0.0

type UnresolvedImportError

type UnresolvedImportError struct {
	ImportLocation common.Location
	ast.Range
}

func (*UnresolvedImportError) Error

func (e *UnresolvedImportError) Error() string

func (*UnresolvedImportError) IsUserError added in v0.25.0

func (*UnresolvedImportError) IsUserError()

type UnsupportedOptionalChainingAssignmentError

type UnsupportedOptionalChainingAssignmentError struct {
	ast.Range
}

func (*UnsupportedOptionalChainingAssignmentError) Error

func (*UnsupportedOptionalChainingAssignmentError) IsUserError added in v0.25.0

type UnsupportedOverloadingError

type UnsupportedOverloadingError struct {
	DeclarationKind common.DeclarationKind
	ast.Range
}

func (*UnsupportedOverloadingError) Error

func (*UnsupportedOverloadingError) IsUserError added in v0.25.0

func (*UnsupportedOverloadingError) IsUserError()

type UnsupportedResourceForLoopError

type UnsupportedResourceForLoopError struct {
	ast.Range
}

func (*UnsupportedResourceForLoopError) Error

func (*UnsupportedResourceForLoopError) IsUserError added in v0.25.0

func (*UnsupportedResourceForLoopError) IsUserError()

type ValidTopLevelDeclarationsHandlerFunc added in v0.5.0

type ValidTopLevelDeclarationsHandlerFunc func(common.Location) common.DeclarationKindSet

type ValueDeclaration

type ValueDeclaration interface {
	ValueDeclarationName() string
	ValueDeclarationType() Type
	ValueDeclarationDocString() string
	ValueDeclarationKind() common.DeclarationKind
	ValueDeclarationPosition() *ast.Position
	ValueDeclarationIsConstant() bool
	ValueDeclarationArgumentLabels() []string
}

type ValueIndexableType

type ValueIndexableType interface {
	Type

	AllowsValueIndexingAssignment() bool
	ElementType(isAssignment bool) Type
	IndexingType() Type
	// contains filtered or unexported methods
}

ValueIndexableType is a type which can be indexed into using a value

type ValueIndexingInfo added in v0.13.2

type ValueIndexingInfo struct {
	ElementType                   func(_ bool) Type
	IndexingType                  *NumericType
	IsValueIndexableType          bool
	AllowsValueIndexingAssignment bool
}

type Variable

type Variable struct {
	// Type is the type of the variable
	Type Type
	// Pos is the position where the variable was declared
	Pos        *ast.Position
	Identifier string
	// DocString is the optional docstring
	DocString string

	// ArgumentLabels are the argument labels that must be used in an invocation of the variable
	ArgumentLabels  []string
	DeclarationKind common.DeclarationKind
	// Access is the access modifier
	Access Access
	// ActivationDepth is the depth of scopes in which the variable was declared
	ActivationDepth int
	// IsConstant indicates if the variable is read-only
	IsConstant bool
	// contains filtered or unexported fields
}

type VariableActivation added in v0.14.0

type VariableActivation struct {
	Parent         *VariableActivation
	LeaveCallbacks []func(EndPositionGetter)
	Depth          int
	// contains filtered or unexported fields
}

An VariableActivation is a map of strings to variables. It is used to represent an active scope in a program, i.e. it is used as a symbol table during semantic analysis.

func NewVariableActivation added in v0.14.0

func NewVariableActivation(parent *VariableActivation) *VariableActivation

NewVariableActivation returns as new activation with the given parent. The parent may be nil.

func (*VariableActivation) Clear added in v0.14.1

func (a *VariableActivation) Clear()

Clear removes all variables from this activation.

func (*VariableActivation) DeclareType added in v0.26.0

func (a *VariableActivation) DeclareType(declaration TypeDeclaration)

func (*VariableActivation) DeclareValue added in v0.26.0

func (a *VariableActivation) DeclareValue(declaration ValueDeclaration)

func (*VariableActivation) Find added in v0.14.0

func (a *VariableActivation) Find(name string) *Variable

Find returns the variable for a given name in the activation. It returns nil if no variable is found.

func (*VariableActivation) ForEach added in v0.14.0

func (a *VariableActivation) ForEach(cb func(string, *Variable) error) error

ForEach calls the given function for each name-variable pair in the activation. It can be used to iterate over all entries of the activation.

func (*VariableActivation) Set added in v0.14.0

func (a *VariableActivation) Set(name string, variable *Variable)

Set sets the given variable.

func (*VariableActivation) SetParent added in v0.14.1

func (a *VariableActivation) SetParent(parent *VariableActivation)

SetParent sets the parent of this activation to the given parent and updates the depth.

type VariableActivations

type VariableActivations struct {
	// contains filtered or unexported fields
}

VariableActivations is a stack of activation records. Each entry represents a new activation record.

The current / most nested activation record can be found at the top of the stack (see function `Current`).

func NewVariableActivations added in v0.14.1

func NewVariableActivations(parent *VariableActivation) *VariableActivations

func NewVariableActivationsFromHandler added in v0.42.1

func NewVariableActivationsFromHandler(
	handler ActivationHandlerFunc,
	location common.Location,
	defaultActivation *VariableActivation,
) *VariableActivations

func (*VariableActivations) Current added in v0.13.3

Current returns the current / most nested activation, which can be found at the top of the stack. It returns nil if there is no active activation.

func (*VariableActivations) DeclareValue added in v0.27.0

func (a *VariableActivations) DeclareValue(declaration ValueDeclaration) (*Variable, error)

func (*VariableActivations) Depth

func (a *VariableActivations) Depth() int

Depth returns the depth (size) of the activation stack.

func (*VariableActivations) Enter

func (a *VariableActivations) Enter()

Enter pushes a new empty activation to the top of the activation stack. The new activation has the current activation as its parent.

func (*VariableActivations) Find

func (a *VariableActivations) Find(name string) *Variable

Find returns the variable for a given name in the current activation. It returns nil if no variable is found or if there is no current activation.

func (*VariableActivations) ForEachVariableDeclaredInAndBelow added in v0.16.0

func (a *VariableActivations) ForEachVariableDeclaredInAndBelow(depth int, f func(name string, value *Variable))

func (*VariableActivations) Leave

func (a *VariableActivations) Leave(getEndPosition func(common.MemoryGauge) ast.Position)

Leave pops the top-most (current) activation from the top of the activation stack.

func (*VariableActivations) Set

func (a *VariableActivations) Set(name string, variable *Variable)

Set sets the variable in the current activation.

type VariableDeclarationTypes added in v0.26.0

type VariableDeclarationTypes struct {
	ValueType       Type
	SecondValueType Type
	TargetType      Type
}

type VariableSizedType

type VariableSizedType struct {
	Type Type
	// contains filtered or unexported fields
}

VariableSizedType is a variable sized array type

func NewVariableSizedType added in v0.24.0

func NewVariableSizedType(memoryGauge common.MemoryGauge, typ Type) *VariableSizedType

func (*VariableSizedType) AllowsValueIndexingAssignment added in v0.7.0

func (*VariableSizedType) AllowsValueIndexingAssignment() bool

func (*VariableSizedType) CheckInstantiated added in v1.0.0

func (t *VariableSizedType) CheckInstantiated(pos ast.HasPosition, memoryGauge common.MemoryGauge, report func(err error))

func (*VariableSizedType) ContainFieldsOrElements added in v1.0.0

func (t *VariableSizedType) ContainFieldsOrElements() bool

func (*VariableSizedType) ElementType

func (t *VariableSizedType) ElementType(_ bool) Type

func (*VariableSizedType) Equal

func (t *VariableSizedType) Equal(other Type) bool

func (*VariableSizedType) GetMembers added in v0.7.0

func (t *VariableSizedType) GetMembers() map[string]MemberResolver

func (*VariableSizedType) ID

func (t *VariableSizedType) ID() TypeID

func (*VariableSizedType) IndexingType

func (t *VariableSizedType) IndexingType() Type

func (*VariableSizedType) IsComparable added in v0.39.0

func (t *VariableSizedType) IsComparable() bool

func (*VariableSizedType) IsEquatable added in v0.7.0

func (t *VariableSizedType) IsEquatable() bool

func (*VariableSizedType) IsExportable added in v0.30.0

func (t *VariableSizedType) IsExportable(results map[*Member]bool) bool

func (*VariableSizedType) IsImportable added in v0.17.0

func (t *VariableSizedType) IsImportable(results map[*Member]bool) bool

func (*VariableSizedType) IsInvalidType

func (t *VariableSizedType) IsInvalidType() bool

func (*VariableSizedType) IsOrContainsReferenceType added in v1.0.0

func (t *VariableSizedType) IsOrContainsReferenceType() bool

func (*VariableSizedType) IsPrimitiveType added in v1.0.0

func (t *VariableSizedType) IsPrimitiveType() bool

func (*VariableSizedType) IsResourceType

func (t *VariableSizedType) IsResourceType() bool

func (*VariableSizedType) IsStorable added in v0.5.0

func (t *VariableSizedType) IsStorable(results map[*Member]bool) bool

func (*VariableSizedType) IsType

func (*VariableSizedType) IsType()

func (*VariableSizedType) Map added in v1.0.0

func (t *VariableSizedType) Map(gauge common.MemoryGauge, typeParamMap map[*TypeParameter]*TypeParameter, f func(Type) Type) Type

func (*VariableSizedType) QualifiedString

func (t *VariableSizedType) QualifiedString() string

func (*VariableSizedType) Resolve

func (t *VariableSizedType) Resolve(typeArguments *TypeParameterTypeOrderedMap) Type

func (*VariableSizedType) RewriteWithIntersectionTypes added in v1.0.0

func (t *VariableSizedType) RewriteWithIntersectionTypes() (Type, bool)

func (*VariableSizedType) String

func (t *VariableSizedType) String() string

func (*VariableSizedType) SupportedEntitlements added in v1.0.0

func (t *VariableSizedType) SupportedEntitlements() *EntitlementSet

func (*VariableSizedType) Tag added in v0.24.0

func (t *VariableSizedType) Tag() TypeTag

func (*VariableSizedType) TypeAnnotationState

func (t *VariableSizedType) TypeAnnotationState() TypeAnnotationState

func (*VariableSizedType) Unify

func (t *VariableSizedType) Unify(
	other Type,
	typeParameters *TypeParameterTypeOrderedMap,
	report func(err error),
	memoryGauge common.MemoryGauge,
	outerRange ast.HasPosition,
) bool

type VirtualImport added in v0.5.0

type VirtualImport struct {
	ValueElements *StringImportElementOrderedMap
	TypeElements  *StringImportElementOrderedMap
}

func (VirtualImport) AllTypeElements added in v0.5.0

func (i VirtualImport) AllTypeElements() *StringImportElementOrderedMap

func (VirtualImport) AllValueElements added in v0.5.0

func (i VirtualImport) AllValueElements() *StringImportElementOrderedMap

func (VirtualImport) IsChecking added in v0.10.0

func (VirtualImport) IsChecking() bool

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL