nasa / trick

Trick Simulation Environment. Trick provides a common set of simulation capabilities and utilities to build simulations automatically.
Other
34 stars 19 forks source link

write template directive before template instance #1679

Closed excaliburtb closed 5 months ago

excaliburtb commented 6 months ago

in newer swig versions. 4.2.1 confirmed.. maybe issue with any 4.x version, a template with a private copy constructor or operator will generate setters for the instance because swig doesn't know what the template is. swig documentation says to write the %template directive first.

This PR does that though I'm no expert on regex. feel free to rework as needed but this PR gets the job done for swig 4.2.1 and is backwards compatible with 3.0.12

See attachment to reproduce the error:

template_error.zip

coveralls commented 6 months ago

Coverage Status

coverage: 55.945% (-0.007%) from 55.952% when pulling 0454562c6d34253a8561ccf6ea878978c8fefbe9 on excaliburtb:swig_template_fix into 5065d96a15940cd9f5dacad37a10a6f28ba96d44 on nasa:master.

sharmeye commented 6 months ago

@alexlin0 you wrote this in perl, this is your fault. Please read this and tell us what it says

excaliburtb commented 5 months ago

template_error_v2.zip