Skip to main content
Participating Frequently
March 18, 2011
Question

Flex Hero: Number.MIN_VALUE in ctor gives compile error

  • March 18, 2011
  • 1 reply
  • 990 views

It's not a question, just a note, that I don't really understand what changed since Flex 4.1 that this doesn't compile.

public class ComplexType
{
     public function ComplexType(prop:Number = Number.MIN_VALUE)
     {      } }

1047: Parameter initializer unknown or is not a compile-time constant. ComplexType.as /HeroTestbed/src/com/cuketa/herotestbed line 5 Flex Problem

This topic has been closed for replies.

1 reply

Participant
September 23, 2011

Just to note, this is still a problem in Flex 4.5.1. Sometimes I was able to replace Number.MIN_VALUE and Number.MAX_VALUE in my own code with 1E+100 and -1E+100 in parameter initializers, but sometimes Flex just decides that it's going to give the same error then. I'll replace it with "100" or something silly, let it build, and then replace is back with 1E+100 and it'll stop complaining.

This is just rediculous!