Add native function declarations for all relevant Test contract functions#2823
Add native function declarations for all relevant Test contract functions#2823m-Peter wants to merge 2 commits intoonflow:masterfrom
Test contract functions#2823Conversation
|
I am still getting some checking errors for native function declarations with type parameters, e.g.: panic: Checking failed:
error: cannot find type in this scope: `T`
--> Test:445:50The relevant function declaration is: /// Creates a matcher with a test function.
/// The test function is of type '((T): Bool)',
/// where 'T' is bound to 'AnyStruct'.
///
access(all)
native fun newMatcher<T: AnyStruct>(_ test: ((T): Bool)): Test.Matcher {}To my knowledge, I have updated all the relevant parser.Config{
NativeModifierEnabled: true,
TypeParametersEnabled: true,
}
&sema.Config{
BaseValueActivation: activation,
AccessCheckMode: sema.AccessCheckModeStrict,
AllowNativeDeclarations: true,
}What could be the root cause of this checking error? 🤔 |
b290058 to
4f89232
Compare
|
Can you maybe rebase the PR on top of #2850, and see if this is now solved? |
4f89232 to
6eb4de7
Compare
|
Hey @SupunS, I have rebased on top of master, and indeed the checking error regarding type parameters is solved. However, I hit another roadblock in this commit 6eb4de7. Basically, we have two functions with arity ( // `message` parameter is optional
Arity: &sema.Arity{Min: 1, Max: 2},Which is not possible to somehow define with |
6eb4de7 to
e4bba03
Compare
|
Closing this in favor of #2926 |
Closes #2822
Description
With the introduction of #2821, we can now declare native functions inside the
Testcontract, and remove the workaround that usedCompositeType.ResolveMembers().masterbranchFiles changedin the Github PR explorer