Skip to content

compiler fails to reject a program #164

@hemmecke

Description

@hemmecke

The following program is missing == at position (*), but still compiles fine.
I only detected that problem, because, when I wanted to use uNCoefficient, the interpreter claimed that that function is not defined in QEtaOneOverPi(Integer).

The only hint I can see is:

   Semantic Errors: 
      [1]  C is not a known type

I wonder by which reasoning the compiler is able to accept that program.

Here is the program

PP ==> PositiveInteger
ZZ ==> Integer
MZZ ==> Matrix ZZ -- consider only 2x2 matricies
)abbrev package Q1PI QEtaOneOverPi
QEtaOneOverPi(C: IntegralDomain): Exports == Implementation where
  Exports ==> with
    uNCoefficient: (PP, MZZ, C) -> C
    if C has Field then
        moebiusTransform: (MZZ, C) -> C
  Implementation ==> add
    uNCoefficient(nn: PP, gamma: MZZ, tau: C): C -----------------------------(*)
        c: ZZ := gamma(2,1)
        d: ZZ := gamma(2,2)
        determinant(gamma) - nn*(c*tau+d)^2
    if C has Field then
        moebiusTransform(gamma: MZZ, x: C): C ==
            (gamma(1,1)*x+gamma(1,2)::C) / (gamma(2,1)*x+gamma(2,2)::C)

If you remove the last iF and all lines below, then the compiler says

   QEtaOneOverPi has 1 precompilation error:
    Parsing error: Apparent indentation error following add 

 
   >> Apparent user error:
   precompilation failed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions