Jira (PUP-11518) remove compiler errors for deferred function mismatched types

13 views
Skip to first unread message

Tony Vu (Jira)

unread,
Apr 29, 2022, 5:06:01 PM4/29/22
to puppe...@googlegroups.com
Tony Vu updated an issue
 
Puppet / Story PUP-11518
remove compiler errors for deferred function mismatched types
Change By: Tony Vu
Summary: Update the type system to handle remove compiler errors for deferred functions function mismatched types
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo

Tony Vu (Jira)

unread,
Apr 29, 2022, 5:19:01 PM4/29/22
to puppe...@googlegroups.com
Tony Vu updated an issue
Problem 1. It's not possible to pass Usage of a Deferred deferred function to will fail compilation when used as typed parameter value when requiring a class that accepts . The compiler will error on a Sensitive mismatch of the parameter during *compilation on type and the server* yet-to-be-resolved deferred function.
 
For 1 Functions can have their return type specified , I think it's reasonable which can then be tested to "update match the parameter type system . Many functions do not specify their return_type though , and so in that scenario the Deferred type, to pass validation as compiler should clearly warn that the type compiler cannot guarantee the deferred correctness of the return value of the function will resolve to" Maggie/Froyo are going to spike this .

Tony Vu (Jira)

unread,
May 11, 2022, 11:10:02 AM5/11/22
to puppe...@googlegroups.com
Tony Vu updated an issue
Change By: Tony Vu
Sprint: Phoenix 2022-05-11 , Phoenix 2022-05-25

Josh Cooper (Jira)

unread,
May 17, 2022, 3:03:03 PM5/17/22
to puppe...@googlegroups.com

Tony Vu (Jira)

unread,
May 17, 2022, 4:04:03 PM5/17/22
to puppe...@googlegroups.com
Tony Vu updated an issue
Change By: Tony Vu
Release Notes: Bug Fix
Release Notes Summary: Before this fix, it was not possible to compile a catalog that used a `Deferred` value for a typed parameter class; the compiler would error with a message stating that the type expected did not match `Deferred`.  With this fix, the compiler will inspect the Deferred class's return type and ensure it matches the class parameter type. If the Deferred function has no return type, the compiler will warn that it cannot guarantee the type will adhere to the type the class specifies.

Parker Leach (Jira)

unread,
May 23, 2022, 12:34:03 PM5/23/22
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages