anuragraghavan / franca

Automatically exported from code.google.com/p/franca
0 stars 0 forks source link

Redefinitions should be considered as errors #61

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If some interface name is used several times within the same package, there is 
no error from Franca - even if those definitions are different.

The following Franca snippet is accepted without error in Franca 0.8.8:

interface TestInterface {
version {
        major 5
        minor 0
    }
}
interface TestInterface {
    version {
        major 5
        minor 0
    }
    method foo {
    }
}

Original issue reported on code.google.com by manfred....@bmw.de on 9 Sep 2013 at 8:50

GoogleCodeExporter commented 9 years ago
please note that the example above uses same interface version (major/minor) 
for both definitions which should be forbidden in any case.
It could make sense to allow interface definition with several versions, but 
how to reference a specific version of an interface definition in Franca, e.g. 
for extends? 

Original comment by manfred....@bmw.de on 9 Sep 2013 at 11:35

GoogleCodeExporter commented 9 years ago
Added check for duplicate interface names.

If an interface exists with multiple versions, this should be done in different 
files. The actual files which are loaded (e.g. by a code generator) determine 
the interface version.

Original comment by klaus.birken@gmail.com on 20 Sep 2013 at 3:28

GoogleCodeExporter commented 9 years ago
that is true, the ecore model can distinguish versions and therefore code 
generators will also be enabled distinguish them.
But if several versions of the same interface are contained within one Franca 
file how to refer to a certain version if such interface is extended by another 
interface?
Example: does ExtendedInterface version 1.0 contain method foo() below?

interface TestInterface {
version {
        major 1
        minor 0
    }
}
interface TestInterface {
    version {
        major 2
        minor 0
    }
    method foo {
    }
}

interface ExtendedInterface extends TestInterface {
    version {
        major 1
        minor 0
    }
}

Original comment by manfred....@bmw.de on 20 Sep 2013 at 3:54

GoogleCodeExporter commented 9 years ago
Added cross-file validation for unique interface names (across import 
statements) with commit 2ec85bf.

Original comment by klaus.birken@gmail.com on 23 Sep 2013 at 11:29

GoogleCodeExporter commented 9 years ago
Regarding comment 3: It is not allowed in Franca that several versions of the 
same interface are included in one fidl-file. If multiple versions have to be 
handled, an SCM system and the file system have to be used. 

Original comment by klaus.birken@gmail.com on 23 Sep 2013 at 11:31