View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0037919 | pas2js | transpiler | public | 2020-10-13 20:35 | 2020-11-03 12:54 |
Reporter | henrique | Assigned To | Mattias Gaertner | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | Pas2Js | OS | Windows | ||
Summary | 0037919: Optimizer is removing class declaration | ||||
Description | When I declare a custom attribute, the optimizer is removing the declaration from the class in the final generated file. I've set up an example with the problem occurring. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 47283. | ||||
Attached Files |
|
|
|
|
I compiled your example and I see in the Error.js: $r.attr = [$mod.Attribute,"Create"]; What is missing? |
|
The class of the atrribute is missing, in the generated file. |
|
I've attached an example that shows this as a runtime exception (except if the assignment to "m" is enabled) tattr.pp (579 bytes)
program tattr; {$mode objfpc} {$modeswitch prefixedattributes} uses Rtti; type MyAttribute = class(TCustomAttribute) end; [MyAttribute] TTest = class end; var context: TRTTIContext; t: TRttiType; attrs: TCustomAttributeArray; attr: TCustomAttribute; m: MyAttribute; begin //m := MyAttribute.Create; context := TRTTIContext.Create; try t := context.GetType(TTest); attrs := t.GetAttributes; for attr in attrs do begin Writeln(attr.ClassName); end; finally context.Free; end; end. |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-10-13 20:35 | henrique | New Issue | |
2020-10-13 20:35 | henrique | File Added: Error.zip | |
2020-10-13 22:26 | Mattias Gaertner | Assigned To | => Mattias Gaertner |
2020-10-13 22:26 | Mattias Gaertner | Status | new => assigned |
2020-10-28 22:05 | Mattias Gaertner | Status | assigned => feedback |
2020-10-28 22:05 | Mattias Gaertner | Note Added: 0126619 | |
2020-10-28 22:12 | henrique | Status | feedback => assigned |
2020-10-28 22:16 | henrique | Note Added: 0126623 | |
2020-10-30 14:39 | Mattias Gaertner | Status | assigned => confirmed |
2020-10-30 15:03 | Sven Barth | Note Added: 0126660 | |
2020-10-30 15:03 | Sven Barth | File Added: tattr.pp | |
2020-11-02 16:04 | Mattias Gaertner | Status | confirmed => resolved |
2020-11-02 16:04 | Mattias Gaertner | Resolution | open => fixed |
2020-11-02 16:04 | Mattias Gaertner | Fixed in Revision | => 47283. |