| | @@ -1115,6 +1115,9 @@ |
| 1115 | 1115 | Expression(x, nil); |
| 1116 | 1116 | Expect(sRparen); |
| 1117 | 1117 | Convert(x, t); |
| 1118 | + { a conversion is a factor, not a designator: nothing selects from it } |
| 1119 | + if tok = sArrow then |
| 1120 | + MarkHelp(TokPos, 'a conversion can''t be dereferenced', 'convert into a pointer variable, then dereference that'); |
| 1118 | 1121 | end; |
| 1119 | 1122 | else Expected('an expression'); |
| 1120 | 1123 | end; |
| | @@ -1789,6 +1792,7 @@ |
| 1789 | 1792 | Jump(curLoop^.brk); |
| 1790 | 1793 | end; |
| 1791 | 1794 | sDefer: Defer; |
| 1795 | + sArrow: MarkHelp(TokPos, 'a statement starts with a name', 'convert into a pointer variable, then assign through that'); |
| 1792 | 1796 | else if AtLineStart then EndMissing(MissingPos, 'expected "end", found ' + Found) |
| 1793 | 1797 | else Expected('a statement'); |
| 1794 | 1798 | end; |
| | @@ -2722,7 +2726,11 @@ |
| 2722 | 2726 | Expect(sModule); |
| 2723 | 2727 | if (tok <> sIdent) or (id <> n) then Mark('expected module ' + NameOf(n) + ', found ' + Found); |
| 2724 | 2728 | Next; |
| 2725 | | - if tok = sLparen then Params(m) |
| 2729 | + { the module first pending is the one named on the command line, |
| 2730 | + which nothing imports, so no arguments come with it } |
| 2731 | + if (tok = sLparen) and not checkOnly and (numPending = 1) then |
| 2732 | + Mark(NameOf(n) + ' is generic: it is compiled where a module imports it') |
| 2733 | + else if tok = sLparen then Params(m) |
| 2726 | 2734 | else if args.n > 0 then MarkAt(args.at, NameOf(n) + ' isn''t generic'); |
| 2727 | 2735 | Expect(sSemicolon); |
| 2728 | 2736 | while tok = sImport do begin |